Skip to content

Commit

Permalink
Address comment from @reta
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chu <[email protected]>
  • Loading branch information
noCharger committed Sep 26, 2023
1 parent e7344ab commit a85be4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
- type: word_delimiter
split_on_numerics: false
type_table:
- "# This is a comment"
- "# => ALPHANUM"
- length: { tokens: 2 }
- match: { tokens.0.token: text1 }
Expand All @@ -176,6 +177,7 @@
- type: word_delimiter
split_on_numerics: false
type_table:
- "# This is a comment"
- "# => ALPHANUM"
- "@ => ALPHANUM"
- length: { tokens: 2 }
Expand Down Expand Up @@ -321,6 +323,7 @@
- type: word_delimiter_graph
split_on_numerics: false
type_table:
- "# This is a comment"
- "# => ALPHANUM"
- length: { tokens: 2 }
- match: { tokens.0.token: text1 }
Expand All @@ -341,6 +344,7 @@
- type: word_delimiter_graph
split_on_numerics: false
type_table:
- "# This is a comment"
- "# => ALPHANUM"
- "@ => ALPHANUM"
- length: { tokens: 2 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class Analysis {
private static final Logger LOGGER = LogManager.getLogger(Analysis.class);

// Regular expression to support hashtag tokenization
private static Pattern hashTagRulePattern = Pattern.compile("^\\s*#\\s*=>");
private static final Pattern HASH_TAG_RULE_PATTERN = Pattern.compile("^\\s*#\\s*=>");

public static CharArraySet parseStemExclusion(Settings settings, CharArraySet defaultStemExclusion) {
String value = settings.get("stem_exclusion");
Expand Down Expand Up @@ -249,7 +249,7 @@ public static <T> List<T> parseWordList(
int lineNum = 0;
for (String word : words) {
lineNum++;
if (word.startsWith("#") == false || hashTagRulePattern.matcher(word).find()) {
if (word.startsWith("#") == false || HASH_TAG_RULE_PATTERN.matcher(word).find() == true) {
try {
rules.add(parser.apply(word));
} catch (RuntimeException ex) {
Expand Down

0 comments on commit a85be4d

Please sign in to comment.