1   package org.daisy.pipeline.nlp.impl.matchrules;
2   
3   import java.util.ArrayList;
4   import java.util.Collection;
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  /**
12   * Match compact abbreviations such as "etc.", but "e.t.c" does not match.
13   */
14  public class CompactAbbrMatchRule extends WordListMatchRule {
15  	public CompactAbbrMatchRule(Category category, int priority, boolean caseSensitive,
16  	        MatchMode matchMode, boolean capitalSensitive, Locale locale) {
17  		super(category, priority, caseSensitive, matchMode, capitalSensitive, locale);
18  	}
19  
20  	public void init(Collection<String> rawAbbrs) {
21  		List<String> abbrs = new ArrayList<String>();
22  		for (String prefix : rawAbbrs) {
23  			abbrs.add(prefix + ".");
24  		}
25  
26  		super.init(abbrs);
27  	}
28  }