Skip to content

Commit

Permalink
Fixed up List/Array mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterm8 authored and Stanford NLP committed Jan 7, 2017
1 parent 8e12fc7 commit cc35546
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/edu/stanford/nlp/pipeline/TokensRegexAnnotator.java
Expand Up @@ -63,8 +63,8 @@ public TokensRegexAnnotator(String... files) {

public TokensRegexAnnotator(String name, Properties props) {
String prefix = (name == null)? "": name + '.';
String[] files = StringUtils.split(props.getProperty(prefix + "rules"), "\\s*[,;]\\s*")
if (files == null || files.length == 0) {
List<String> files = StringUtils.split(props.getProperty(prefix + "rules"), "\\s*[,;]\\s*");
if (files.isEmpty()) {
throw new RuntimeException("No rules specified for TokensRegexAnnotator " + name + ", check " + prefix + "rules property");
}
env = TokenSequencePattern.getNewEnv();
Expand Down

0 comments on commit cc35546

Please sign in to comment.