/** Get iterators for each token in this offset */ private PropertyList.Iterator[] getOffsetIters (int [][] conjunctions, int j, int tsSize, int tsi, PropertyList[] oldfs) { PropertyList.Iterator[] iters = new PropertyList.Iterator[conjunctions[j].length]; // get iterators for offsets for (int iteri=0; iteri < iters.length; iteri++) { iters[iteri] = getOffsetIter (conjunctions, j, iteri, tsSize, tsi, oldfs); if (iters[iteri]==null) return null; } return iters; }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean tagAllTimesteps) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), tagAllTimesteps); }
public void add(String word) { add(word, false, " "); }
public static void addSmallLexicons(List<String> usedPipeNames, List<Pipe> pipes, boolean ignoreCase) throws FileNotFoundException { usedPipeNames.add("SmallLex"); pipes.add(new LexiconMembership("chudlerListWord", new File( LEXICON_HOME + "chudler.txt"), ignoreCase)); pipes.add(new LexiconMembership("directionWord", new File(LEXICON_HOME + "directions.txt"), ignoreCase)); pipes.add(new LexiconMembership("extendedDirectionWord", new File( LEXICON_HOME + "extendedDirections.txt"), ignoreCase)); pipes.add(new LexiconMembership("stopWord", new File(LEXICON_HOME + "stop.txt"), ignoreCase)); }
public static void addTextPipe(List<String> usedPipeNames, List<Pipe> pipes) throws Exception { usedPipeNames.add("Text"); pipes.add(new TokenText("text=")); }
/** * Create a Pipe for adding conjunctions of specified features. * @param thisFeatureName Name of this conjunction feature. * @param featureNames String giving name for each subfeature i. * @param offsets For each subfeature i, which offset from the current timestep * must i appear at. * @param isNonNegated If element i is false, then the negation of the * feature is added to the conjuction. */ public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean[] isNonNegated, boolean tagAllTimesteps) { this.thisFeatureName = thisFeatureName; this.featurePatterns = patternify (featureNames); this.offsets = offsets; this.isNonNegated = isNonNegated; this.tagAllTimesteps = tagAllTimesteps; }
public Instance pipe(Instance carrier) { TokenSequence ts = (TokenSequence) carrier.getData(); lexicon.addFeatures(ts); return carrier; }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean tagAllTimesteps) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), tagAllTimesteps); }
/** Get iterators for each token in this offset */ private PropertyList.Iterator[] getOffsetIters (int [][] conjunctions, int j, int tsSize, int tsi, PropertyList[] oldfs) { PropertyList.Iterator[] iters = new PropertyList.Iterator[conjunctions[j].length]; // get iterators for offsets for (int iteri=0; iteri < iters.length; iteri++) { iters[iteri] = getOffsetIter (conjunctions, j, iteri, tsSize, tsi, oldfs); if (iters[iteri]==null) return null; } return iters; }
public void add(String word) { add(word, false, " "); }
/** * Create a Pipe for adding conjunctions of specified features. * @param thisFeatureName Name of this conjunction feature. * @param featureNames String giving name for each subfeature i. * @param offsets For each subfeature i, which offset from the current timestep * must i appear at. * @param isNonNegated If element i is false, then the negation of the * feature is added to the conjuction. */ public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean[] isNonNegated, boolean tagAllTimesteps) { this.thisFeatureName = thisFeatureName; this.featurePatterns = patternify (featureNames); this.offsets = offsets; this.isNonNegated = isNonNegated; this.tagAllTimesteps = tagAllTimesteps; }
public Instance pipe(Instance carrier) { TokenSequence ts = (TokenSequence) carrier.getData(); lexicon.addFeatures(ts); return carrier; }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean tagAllTimesteps) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), tagAllTimesteps); }
/** Get iterators for each token in this offset */ private PropertyList.Iterator[] getOffsetIters (int [][] conjunctions, int j, int tsSize, int tsi, PropertyList[] oldfs) { PropertyList.Iterator[] iters = new PropertyList.Iterator[conjunctions[j].length]; // get iterators for offsets for (int iteri=0; iteri < iters.length; iteri++) { iters[iteri] = getOffsetIter (conjunctions, j, iteri, tsSize, tsi, oldfs); if (iters[iteri]==null) return null; } return iters; }
public void add(String word) { add(word, false, " "); }
/** * Create a Pipe for adding conjunctions of specified features. * @param thisFeatureName Name of this conjunction feature. * @param featureNames String giving name for each subfeature i. * @param offsets For each subfeature i, which offset from the current timestep * must i appear at. * @param isNonNegated If element i is false, then the negation of the * feature is added to the conjuction. */ public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets, boolean[] isNonNegated, boolean tagAllTimesteps) { this.thisFeatureName = thisFeatureName; this.featurePatterns = patternify (featureNames); this.offsets = offsets; this.isNonNegated = isNonNegated; this.tagAllTimesteps = tagAllTimesteps; }
public Instance pipe(Instance carrier) { TokenSequence ts = (TokenSequence) carrier.getData(); lexicon.addFeatures(ts); return carrier; }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), false); }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), false); }
public OffsetFeatureConjunction (String thisFeatureName, String[] featureNames, int[] offsets) { this (thisFeatureName, featureNames, offsets, trueArray(featureNames.length), false); }