@Test public void testClassify() { FeatureVector result = affixesClassifier.classify(testWord); assertTrue(result != null); String[] resultArray = result.discreteValueArray(); assertEquals("tion", resultArray[5]); }
public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Affixes(Word)' defined on line 107 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int N = word.form.length(); for (int i = 3; i <= 4; ++i) { if (word.form.length() > i) { __id = "p|"; __value = "" + (word.form.substring(0, i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } for (int i = 1; i <= 4; ++i) { if (word.form.length() > i) { __id = "s|"; __value = "" + (word.form.substring(N - i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } return __result; }
Affixes extends Classifier { public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Affixes(Word)' defined on line 107 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int N = word.form.length(); for (int i = 3; i <= 4; ++i) { if (word.form.length() > i) { __id = "p|"; __value = "" + (word.form.substring(0, i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } for (int i = 1; i <= 4; ++i) { if (word.form.length() > i) { __id = "s|"; __value = "" + (word.form.substring(N - i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } return __result; } }
Affixes extends Classifier { public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Affixes(Word)' defined on line 107 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int N = word.form.length(); for (int i = 3; i <= 4; ++i) { if (word.form.length() > i) { __id = "p|"; __value = "" + (word.form.substring(0, i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } for (int i = 1; i <= 4; ++i) { if (word.form.length() > i) { __id = "s|"; __value = "" + (word.form.substring(N - i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } return __result; } Affixes(); }
Affixes extends Classifier { public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Affixes(Word)' defined on line 107 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int N = word.form.length(); for (int i = 3; i <= 4; ++i) { if (word.form.length() > i) { __id = "p|"; __value = "" + (word.form.substring(0, i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } for (int i = 1; i <= 4; ++i) { if (word.form.length() > i) { __id = "s|"; __value = "" + (word.form.substring(N - i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } return __result; } Affixes(); String getInputType(); String getOutputType(); FeatureVector classify(Object __example); FeatureVector[] classify(Object[] examples); int hashCode(); boolean equals(Object o); }
Affixes extends Classifier { public FeatureVector classify(Object __example) { if (!(__example instanceof Word)) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'Affixes(Word)' defined on line 107 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } Word word = (Word) __example; FeatureVector __result; __result = new FeatureVector(); String __id; String __value; int N = word.form.length(); for (int i = 3; i <= 4; ++i) { if (word.form.length() > i) { __id = "p|"; __value = "" + (word.form.substring(0, i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } for (int i = 1; i <= 4; ++i) { if (word.form.length() > i) { __id = "s|"; __value = "" + (word.form.substring(N - i)); __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); } } return __result; } Affixes(); String getInputType(); String getOutputType(); FeatureVector classify(Object __example); FeatureVector[] classify(Object[] examples); int hashCode(); boolean equals(Object o);  }