public List<PatternRule> parsePatternRuleExtraTokens(final String ruleString) {
String rs = ruleString;
rs = rs.replace("<pattern>\n", "<pattern>\n<token/>\n");
rs = rs.replace("</pattern>\n", "<token/>\n</pattern>\n");
final PatternRuleLoader ruleLoader = new PatternRuleLoader();
String ruleFileString = ruleFileHeader + categoriesString + rs + endCategoriesString + endRulesString;
InputStream is = new ByteArrayInputStream(ruleFileString.getBytes());
try {
return ruleLoader.getRules(is, null);
} catch (IOException e) {
return new ArrayList<>();
}
}