/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Anomaly(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public GrammarAnomaly(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public SpellingAnomaly(JCas jcas) { super(jcas); readObject(); }
sentence)) { FSArray suggestedActions = anomaly.getSuggestions(); int n = suggestedActions.size(); FSArray newActions = new FSArray(jcas, n + 1); SuggestedAction action = (SuggestedAction) suggestedActions.get(i); List<String> changedWords = getChangedWords(action.getReplacement(), tokenStrings, getCandidatePosition(anomaly, tokens)); action.setCertainty((float) probability); newActions.set(i, action); SuggestedAction newAction = new SuggestedAction(jcas); newAction.setReplacement(anomaly.getCoveredText()); newAction.setCertainty((float) getSentenceProbability(tokenStrings)); newActions.set(n, newAction); anomaly.setSuggestions(newActions);
/** @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 GrammarAnomaly(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** * Just gets the Suggestion with the highest Certainty. In case there are more suggestions with * certainty 100, it passes the first highest one. * * @param anomaly * the anomaly. * @return the best suggestion. */ private String getBestSuggestion(SpellingAnomaly anomaly) { Float bestCertainty = 0.0f; String bestReplacement = ""; for (int i = 0; i < anomaly.getSuggestions().size(); i++) { Float currentCertainty = anomaly.getSuggestions(i).getCertainty(); String currentReplacement = anomaly.getSuggestions(i).getReplacement(); if (currentCertainty > bestCertainty) { bestCertainty = currentCertainty; bestReplacement = currentReplacement; } if (bestCertainty == 100) { break; } } return bestReplacement; } }
/** @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 SuggestedAction(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** @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 SpellingAnomaly(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** @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 Anomaly(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public SuggestedAction(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** initialize variables to correspond with Cas Type and Features * @generated * @param jcas JCas * @param casType Type */ public GrammarAnomaly_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); } }
/** initialize variables to correspond with Cas Type and Features * @generated * @param jcas JCas * @param casType Type */ public SpellingAnomaly_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); } }
/** initialize variables to correspond with Cas Type and Features * @generated * @param jcas JCas * @param casType Type */ public SuggestedAction_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); casFeat_replacement = jcas.getRequiredFeatureDE(casType, "replacement", "uima.cas.String", featOkTst); casFeatCode_replacement = (null == casFeat_replacement) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_replacement).getCode(); casFeat_certainty = jcas.getRequiredFeatureDE(casType, "certainty", "uima.cas.Float", featOkTst); casFeatCode_certainty = (null == casFeat_certainty) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_certainty).getCode(); } }
/** initialize variables to correspond with Cas Type and Features * @generated * @param jcas JCas * @param casType Type */ public Anomaly_Type(JCas jcas, Type casType) { super(jcas, casType); casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator()); casFeat_description = jcas.getRequiredFeatureDE(casType, "description", "uima.cas.String", featOkTst); casFeatCode_description = (null == casFeat_description) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_description).getCode(); casFeat_suggestions = jcas.getRequiredFeatureDE(casType, "suggestions", "uima.cas.FSArray", featOkTst); casFeatCode_suggestions = (null == casFeat_suggestions) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_suggestions).getCode(); casFeat_category = jcas.getRequiredFeatureDE(casType, "category", "uima.cas.String", featOkTst); casFeatCode_category = (null == casFeat_category) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_category).getCode(); } }
sentence)) { FSArray suggestedActions = anomaly.getSuggestions(); int n = suggestedActions.size(); FSArray newActions = new FSArray(jcas, n + 1); SuggestedAction action = (SuggestedAction) suggestedActions.get(i); List<String> changedWords = getChangedWords(action.getReplacement(), tokenStrings, getCandidatePosition(anomaly, tokens)); action.setCertainty((float) probability); newActions.set(i, action); SuggestedAction newAction = new SuggestedAction(jcas); newAction.setReplacement(anomaly.getCoveredText()); newAction.setCertainty((float) getSentenceProbability(tokenStrings)); newActions.set(n, newAction); anomaly.setSuggestions(newActions);
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Anomaly(JCas jcas) { super(jcas); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public GrammarAnomaly(JCas jcas) { super(jcas); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public SpellingAnomaly(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public SuggestedAction(JCas jcas) { super(jcas); readObject(); }