Phase: SCRules Input: Lookup Split Token NounChunk Options: control = appelt Macro: LIST ( ({NounChunk}{Token.string == ","})[0,10] {NounChunk} ({Token.string == ","})? {Token.category == CC} {NounChunk} ) Rule:SC1 // NP be [CN] NP // An orphan drug is a type of drug. ( ({NounChunk}):subclass {Lookup.minorType == be} ({Token.category == DT})? {Lookup.majorType == CN} ({NounChunk}):superclass ) --> :subclass.Subclass = {rule=SC1}, :superclass.Superclass = {rule=SC1} // 2 Rule:SC1_1 // [(NP,)* and] NP be [CN] NP // Odometry, speedometry and GPS are types of sensors. ( (LIST):subclass {Lookup.minorType == be} ({Token.category == DT})? {Lookup.majorType == CN} ({NounChunk}):superclass ) --> :superclass.Superclass = {rule="SC1_1"}, { // "subclass" matches LHS label List annList = new ArrayList((AnnotationSet)bindings.get("subclass")); //sort the list by offset Collections.sort(annList, new OffsetComparator()); //iterate through the matched annotations for(int i = 0; i < annList.size(); i++) { Annotation anAnn = (Annotation)annList.get(i); // check that the new annotation is a NounChunk if ((anAnn.getType().equals("NounChunk")) ) { FeatureMap features = Factory.newFeatureMap(); // change this for a different rule name" features.put("rule", "SC1_1"); // change "Subclass" for a different annotation name annotations.add(anAnn.getStartNode(), anAnn.getEndNode(), "Subclass", features); } } }