Repository navigation
Conversation
| */ | ||
| public class FuzzyTokenizer | ||
| { | ||
| public class FuzzyTokenizer { |
There was a problem hiding this comment.
I think the name FuzzyTokenizer is not very accurate. Can we rename it to QueryRewriter?
There was a problem hiding this comment.
I just noticed that it's a helper class for QueryRewriter. Still I prefer a different name. Any suggestions?
There was a problem hiding this comment.
How about QuerySegmenter? http://www2003.org/cdrom/papers/poster/p052/xhtml/querysegmentation.html
There was a problem hiding this comment.
Understood... Refactoring to QuerySegmenter
Just asking, after the refactoring, is it ok to have the method named getFuzzyTokens ?
There was a problem hiding this comment.
We want to avoid overloading the word "fuzzy". So I prefer to use getTokens().
|
Actually |
| /** | ||
| * When called returns a single-member list containing most-likely tokenization of phrase | ||
| * Splits phrase into terms by whitespace delimiter | ||
| * For each term, rewrites(tokenizes) term to detect likely missing spaces |
There was a problem hiding this comment.
Add an example to the comments.
|
@chenlica : Added an example in the comments as suggested... Kindly take a look |
|
In the |
| this.phrase = phrase; | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
For line 42 public FuzzyTokenizer(String phrase, rename phrase to queryString since phrase has a special meaning in other modules.
There was a problem hiding this comment.
It does make sense for fuzzyTokenizer.getFuzzyTokens() to be a static function. We are making changes as suggested.
|
High-level comments:
|
| } | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Rename tokenization to tokenizedQuery.
@chenlica : Kindly take a look. |
|
To unblock you, no need to wait for the review from @JavierJia . Go ahead to do the merge after making those changes. We will let @JavierJia doublecheck the logic even after the merge. |
|
Looks good. Please go ahead to do the merge! |
|
Missed refactoring a variable name... |
|
Looks good. Please go ahead to do the merge. |
@chenlica : Can you take a look at the changes? |
| List<String> queryStrings; | ||
| if(allSegmentations) | ||
| queryStrings = QuerySegmenter.bruteGetTokens(searchQuery); | ||
| else |
There was a problem hiding this comment.
bruteGetTokens -> getTokensBruteForce
There was a problem hiding this comment.
We were thinking of refactoring bruteGetTokens -> getAllTokens and getTokens -> getLikelyTokens.
getAllTokens can internally call rewriteTermBruteForce and getLikelyTokens can call rewriteTermDP
@chenlica : Do you think that would be ok?
There was a problem hiding this comment.
Sounds good. The name rewriteTermDP can be better.
@chenlica : Can you give this a review?