Reader reader = new StringReader
("One-two punch. Brang-, not brung-it. This one--not that one--is the right one, -ish.");
final Map<String,String> args = new HashMap<>();
args.put(ICUTokenizerFactory.RULEFILES, "Latn:Latin-dont-break-on-hyphens.rbbi");
ICUTokenizerFactory factory = new ICUTokenizerFactory(args);
factory.inform(new ClasspathResourceLoader(getClass()));
TokenStream stream = factory.create(newAttributeFactory(), reader);
assertTokenStreamContents(stream,
new String[] { "One-two", "punch",
"Brang", "not", "brung-it",
"This", "one", "not", "that", "one", "is", "the", "right", "one", "ish" });