/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public SemanticField(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { for (POS pos : select(aJCas, POS.class)) { for (Token token : JCasUtil.selectCovered(aJCas, Token.class, pos)) { try { String semanticField = ubySemanticFieldResource.getSemanticTag(token); SemanticField semanticFieldAnnotation = new SemanticField(aJCas, token.getBegin(), token.getEnd()); semanticFieldAnnotation.setValue(semanticField); semanticFieldAnnotation.addToIndexes(); } catch (ResourceAccessException e) { throw new AnalysisEngineProcessException(e); } } } }
public static void assertSemanticField(String[] aExpected, Collection<SemanticField> aActual) { if (aExpected == null) { return; } List<String> expected = asList(aExpected); List<String> actual = new ArrayList<String>(); for (SemanticField a : aActual) { actual.add(a.getValue()); } System.out.printf("%-20s - Expected: %s%n", "Semantic field values", asCopyableString(expected)); System.out.printf("%-20s - Actual : %s%n", "Semantic field values", asCopyableString(actual)); assertEquals(asCopyableString(expected, true), asCopyableString(actual, true)); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public SemanticField(int addr, TOP_Type type) { super(addr, type); readObject(); }
try { String semanticField = semanticFieldResource.getSemanticTag(token); SemanticField semanticFieldAnnotation = new SemanticField(aJCas, token.getBegin(), token.getEnd()); semanticFieldAnnotation.setValue(semanticField); semanticFieldAnnotation.addToIndexes();
public static void assertSemanticField(String[] aExpected, Collection<SemanticField> aActual) { if (aExpected == null) { return; } List<String> expected = asList(aExpected); List<String> actual = new ArrayList<String>(); for (SemanticField a : aActual) { actual.add(a.getValue()); } System.out.printf("%-20s - Expected: %s%n", "Semantic field values", asCopyableString(expected)); System.out.printf("%-20s - Actual : %s%n", "Semantic field values", asCopyableString(actual)); assertEquals(asCopyableString(expected, true), asCopyableString(actual, true)); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public SemanticField(int addr, TOP_Type type) { super(addr, type); readObject(); }
try { String semanticField = semanticFieldResource.getSemanticTag(token); SemanticField semanticFieldAnnotation = new SemanticField(aJCas, token.getBegin(), token.getEnd()); semanticFieldAnnotation.setValue(semanticField); semanticFieldAnnotation.addToIndexes();
/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public SemanticField(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public SemanticField(JCas jcas) { super(jcas); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public SemanticField(JCas jcas) { super(jcas); readObject(); }