Skip to content

Removing utf-8 encoding #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test_data/build_inverted_and_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
discard = False
for i in range(1, len(x)):
try:
term = x[i].encode('utf-8')
term = x[i]
try:
term_id = tokens[term]
if term_id not in mapped:
Expand Down
3 changes: 2 additions & 1 deletion test_data/build_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@
output_file.write(str(len(nodes_per_level)) + "\n")
for key, value in sorted(nodes_per_level.iteritems(), key = lambda kv: kv[0]):
output_file.write(str(value) + "\n")
output_file.close()
output_file.close()

4 changes: 2 additions & 2 deletions test_data/extract_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@

dict_file = open(input_filename + ".dict", 'w')
for key in sorted(tokens):
dict_file.write(key.encode('utf-8') + "\n")
dict_file.close()
dict_file.write(key + "\n")
dict_file.close()
4 changes: 2 additions & 2 deletions test_data/map_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
string_len = 0;
mapped = [x[0]]
for i in range(1, len(x)): # x[0] stores the docID
t = x[i].encode('utf-8')
t = x[i]
try:
id = tokens[t]
mapped.append(id)
Expand All @@ -48,4 +48,4 @@

stats_file.write(str(len(tokens)) + "\n")
stats_file.write(str(max_string_len) + "\n")
stats_file.close()
stats_file.close()