Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
/** * Creates an instance of the filter for a given URL of a fprm file defining a * custom configuration. * @param customConfig the URL of a fprm file defining the custom configuration * the filter should be loaded from. The file extension should be .fprm. * The file name should follow the pattern of custom filter configurations, * i.e. contain a filter name like "okf_xmlstream@custom_config.fprm". * @return a new {@link IFilter} object (with its parameters loaded) for the given * configuration identifier, or null if the object could not be created. */ public static IFilter createFilter(URL customConfig) { FilterConfigurationMapper fcMapper = new FilterConfigurationMapper(); DefaultFilters.setMappings(fcMapper, true, true); return fcMapper.createFilter(addCustomConfig(fcMapper, customConfig)); }
sb.append(" { id:").append(nqs(tu.getId())).append(",\n\t"); printINameable(sb, "\t", tu); for (Segment seg : tu.getSourceSegments()) { sb.append("\t\t{seg:\""); appendEscapingNonAscii(sb, TextUnitUtil.toText(seg.text.getCodedText(), seg.text.getCodes())); sb.append("\""); if (seg.text.getCodes().size() == 0) { } else if (e.isDocumentPart()) { DocumentPart dp = e.getDocumentPart(); sb.append(" { id:").append(nqs(dp.getId())).append(",\n\t"); printINameable(sb, "\t", dp); sb.append("referent:").append(dp.isReferent()).append(", "); sb.append("#refs:").append(dp.getReferenceCount()); } else if (e.isStartGroup()) { StartGroup sg = e.getStartGroup(); sb.append(" { id:").append(nqs(sg.getId())).append(", "); printINameable(sb, "\t", sg); sb.append("}"); } else if (e.isEndGroup()) { sb.append(" { id:").append(nqs(eg.getId())).append(",\n\t"); printSkeleton(sb, "\t", eg); printAnnotations(sb, "\t", eg); sb.append("}"); } else {
private static void printSkeleton(StringBuilder sb, String ind, IResource res) { if (res.getSkeleton() != null) { sb.append("skeleton:\""); appendEscapingNonAscii(sb, res.getSkeleton().toString()).append("\",\n").append(ind); } }
queue.add(FilterUtil.createDeepenSegmentationEvent());
@Override public void handleStart() { // add StarDocument event setFilterWriter(createFilterWriter()); eventBuilder.addFilterEvent(createStartFilterEvent()); // load simplifier rules and send as an event if (!Util.isEmpty(params.getSimplifierRules())) { Event cs = FilterUtil.createCodeSimplifierEvent(params.getSimplifierRules()); eventBuilder.addFilterEvent(cs); } }
/** * Creates an instance of the filter for a given configuration identifier * and loads its corresponding parameters. This method accepts a list of the * URLs of fprm files defining custom configurations, and can be used to create * a filter and configure its sub-filters in one call. * @param configId the filter configuration identifier. Can be either one of Okapi * default filter configurations or one of the custom configurations defined in * the fprm files. * @param customConfigs a list of the URLs of fprm files defining custom configurations. * Every file name should follow the pattern of custom filter configurations, * i.e. contain a filter name like "okf_xmlstream@custom_config.fprm". The file extension * should be .fprm. * @return a new {@link IFilter} object (with its parameters loaded) for the given * configuration identifier, or null if the object could not be created. */ public static IFilter createFilter(String configId, URL... customConfigs) { FilterConfigurationMapper fcMapper = new FilterConfigurationMapper(); DefaultFilters.setMappings(fcMapper, true, true); for (URL customConfig : customConfigs) { addCustomConfig(fcMapper, customConfig); } IFilter filter = fcMapper.createFilter(configId); filter.setFilterConfigurationMapper(fcMapper); return filter; }
@Override public void handleStart() { // add StarDocument event setFilterWriter(createFilterWriter()); eventBuilder.addFilterEvent(createStartFilterEvent()); // load simplifier rules and send as an event if (!Util.isEmpty(params.getSimplifierRules())) { Event cs = FilterUtil.createCodeSimplifierEvent(params.getSimplifierRules()); eventBuilder.addFilterEvent(cs); } }
public Event next () { // Cancel if requested if ( canceled ) { parseState = 0; return new Event(EventType.CANCELED); } if ( parseState == 1 ) return start(); else if (parseState == 2 && !Util.isEmpty(((Parameters)getParameters()).getSimplifierRules())) { parseState = 3; // load simplifier rules and send as an event Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); return cs; } else return readItem(); }
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); simplifier.setRules(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
Event cs = FilterUtil.createCodeSimplifierEvent(((Parameters)getParameters()).getSimplifierRules()); queue.add(cs);
eventBuilder.addFilterEvent(FilterUtil.createCodeSimplifierEvent(config.getSimplifierRules()));