mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-23 17:31:41 +00:00
parent
af8050f1b8
commit
61a03b87bc
@ -2,8 +2,8 @@ from wordfreq_builder.word_counts import count_tokens, write_wordlist
|
||||
import argparse
|
||||
|
||||
|
||||
def handle_counts(filename_in, filename_out, lang):
|
||||
counts = count_tokens(filename_in, lang)
|
||||
def handle_counts(filename_in, filename_out):
|
||||
counts = count_tokens(filename_in)
|
||||
write_wordlist(counts, filename_out)
|
||||
|
||||
|
||||
@ -11,6 +11,5 @@ if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('filename_in', help='name of input file containing tokens')
|
||||
parser.add_argument('filename_out', help='name of output file')
|
||||
parser.add_argument('lang', help='language of input file')
|
||||
args = parser.parse_args()
|
||||
handle_counts(args.filename_in, args.filename_out, args.lang)
|
||||
handle_counts(args.filename_in, args.filename_out)
|
||||
|
@ -98,7 +98,7 @@ def wikipedia_deps(dirname_in, languages):
|
||||
lines, 'tokenize_japanese', plain_text_file, mecab_token_file)
|
||||
add_dep(lines, 'count', mecab_token_file, count_file)
|
||||
else:
|
||||
add_dep(lines, 'count', plain_text_file, count_file})
|
||||
add_dep(lines, 'count', plain_text_file, count_file)
|
||||
|
||||
return lines
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user