Skip to content

Commit

Permalink
put phrases first
Browse files Browse the repository at this point in the history
  • Loading branch information
theJrLinguist committed Apr 14, 2019
1 parent 00c2875 commit 38bf8ce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
DOCUMENT_PROPERTIES_FILE = "properties.txt"

## Cut off points
RICCO_MIN_CUTOFF_POINT = 0.01
ROCCHIO_MIN_CUTOFF_POINT = 0.01

## Weights
SINGLE_TERMS_WEIGHT = 1
Expand Down
2 changes: 1 addition & 1 deletion output.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion queries.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"a statement along" "the case) the" "Australia. The submissions" "a drastic effect" "wrote the note,"
"MR DATO’" AND "Miscellaneous Other Wrongs" AND "proceeding. In my" AND "Q. I was" AND "couple of points."
2 changes: 1 addition & 1 deletion query_expander.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def trimVector(vector):
"""
new_vector = dict()
for key, value in vector.items():
if value > RICCO_MIN_CUTOFF_POINT:
if value > ROCCHIO_MIN_CUTOFF_POINT:
new_vector[key] = value
return new_vector

Expand Down
4 changes: 2 additions & 2 deletions search.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def main():
if NO_PHRASES and "\"" in query_data[i]:
query2 = get_query(query_data, query_line=i, multiple_queries=MULTIPLE_QUERIES_IN_FILE, no_phrases=NO_PHRASES)
result2 = get_best_documents(p, dictionary, doc_properties, query2)
result = list(filter(lambda x: x not in result2, result))
result = result2 + result
result2 = list(filter(lambda x: x not in result, result2))
result = result + result2

with open(file_of_output, 'w+') as f:
f.write(' '.join([str(x) for x in result]) + END_LINE_MARKER)
Expand Down

0 comments on commit 38bf8ce

Please sign in to comment.