1   package org.daisy.pipeline.nlp.impl.matchrules;
2   
3   import java.io.File;
4   import java.io.IOException;
5   import java.util.List;
6   import java.util.Locale;
7   
8   import org.daisy.pipeline.nlp.TextCategorizer.Category;
9   import org.daisy.pipeline.nlp.TextCategorizer.MatchMode;
10  
11  import com.google.common.base.Charsets;
12  import com.google.common.io.Files;
13  
14  /**
15   * Match the input strings with a list of strings read from a text file.
16   */
17  public class WordFileMatchRule extends WordListMatchRule {
18  
19  	public WordFileMatchRule(Category category, int priority, boolean caseSensitive,
20  	        MatchMode matchMode, boolean capitalSensitive, Locale locale) {
21  		super(category, priority, caseSensitive, matchMode, capitalSensitive, locale);
22  	}
23  
24  	public void init(String filename) throws IOException {
25  		List<String> prefixes = Files.readLines(new File(filename), Charsets.UTF_8);
26  		super.init(prefixes);
27  	}
28  
29  }