-
Notifications
You must be signed in to change notification settings - Fork 489
OPENNLP-983: Allows length for Prefix and Suffix feature generators to be set #121
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
Conversation
|
Thank you for your PR. The code looks great. Can you please squash the commit and fix the first line of yours commit message? The first line should 72 characters max. |
4dda548 to
938fb91
Compare
|
@wcolen Sure -- I think that's got it. |
| } | ||
|
|
||
| @Test | ||
| public void lengthTest2() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking: possible to come up with a better name for this - never mind if its too long, but it would make better sense to a first timer reading this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree. Those test names are not the most descriptive. I'll consider their names again. If you think of anything better in the meantime let me know.
|
+1 lgtm |
| return prefs; | ||
| public static final int DEFAULT_MAX_LENGTH = 4; | ||
|
|
||
| private int prefixLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be final.
| return suffs; | ||
| public static final int DEFAULT_MAX_LENGTH = 4; | ||
|
|
||
| private int suffixLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be final.
|
Looks like this is almost good to be merged. Can you squash the commits? And address the remaining feedback. |
8fa09ad to
9d25705
Compare
|
@kottmann Yes, commits squashed, added new lines, and made the ints final. |
This pull request makes the length for the Prefix- and SuffixFeatureGenerator configurable. It defaults to 4 (the original value) if not provided. This pull request also prevents duplicate features from being returned in cases where the given length is larger than the token's size.