Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pikulet/intellex
Browse files Browse the repository at this point in the history
  • Loading branch information
theJrLinguist committed Apr 21, 2019
2 parents 1b23860 + 1d51335 commit 3f26a4a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions QueryExpansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,19 @@ def convert_wordnet_terms(terms):

######################## UTIL FUNCTIONS ########################

def drop_AND_phrase(line):
"""
A really simple util function that strips out all bool and phrase markings
:param: line: Query string
"""
result = []
b1, b2, tokens = tokenize(line)
for token in tokens:
if token != AND:
for subtoken in token.split():
result.append(subtoken)
return convert_list_to_string(result)

def tokenize(line):
"""
Tokenises a line to a list of words, using the delimiter as space or ".
Expand Down

0 comments on commit 3f26a4a

Please sign in to comment.