/** * Initialise a HalfPhoneLeftRight feature processor. */ public HalfPhoneLeftRight() { this.values = new ByteStringTranslator(new String[] { "0", "L", "R" }); }
public Pos(String aName, String[] posValues, TargetElementNavigator wordNavi) { this.values = new ByteStringTranslator(posValues); this.navigator = wordNavi; this.name = aName; }
/** * @param name * name of this feature processor * @param wordNavigator * a navigator which returns a word for a target. This navigator decides the word for which the punctuation * will be computed. */ public WordPunc(String name, TargetElementNavigator wordNavigator) { this.name = name; this.navigator = wordNavigator; this.values = new ByteStringTranslator(new String[] { "0", ".", ",", ";", ":", "(", ")", "?", "!", "\"" }); }
public PhoneFeature(AllophoneSet phoneSet, String name, String phonesetQuery, String[] possibleValues, String pauseSymbol, TargetElementNavigator segmentNavigator) { this.phoneSet = phoneSet; this.name = name; this.phonesetQuery = phonesetQuery; this.values = new ByteStringTranslator(possibleValues); this.navigator = segmentNavigator; }
/** * @param name * name of this feature processor * @param wordNavigator * a navigator which returns a word for a target. This navigator decides the word for which the punctuation * will be computed. */ public WordPunc(String name, TargetElementNavigator wordNavigator) { this.name = name; this.navigator = wordNavigator; this.values = new ByteStringTranslator(new String[] { "0", ".", ",", ";", ":", "(", ")", "?", "!", "\"" }); }
public SegOnsetCoda(AllophoneSet phoneSet) { this.phoneSet = phoneSet; this.values = new ByteStringTranslator(new String[] { "0", "onset", "coda" }); }
public BreakIndex() { values = new ByteStringTranslator(new String[] { "0", "1", "2", "3", "4", "5", "6" }); }
public PhoneFeature(AllophoneSet phoneSet, String name, String phonesetQuery, String[] possibleValues, String pauseSymbol, TargetElementNavigator segmentNavigator) { this.phoneSet = phoneSet; this.name = name; this.phonesetQuery = phonesetQuery; this.values = new ByteStringTranslator(possibleValues); this.navigator = segmentNavigator; }
public Pos(String aName, String[] posValues, TargetElementNavigator wordNavi) { this.values = new ByteStringTranslator(posValues); this.navigator = wordNavi; this.name = aName; }
public TobiAccent(String name, TargetElementNavigator syllableNavigator) { this.name = name; this.navigator = syllableNavigator; this.values = new ByteStringTranslator(new String[] { "0", "*", "H*", "!H*", "^H*", "L*", "L+H*", "L*+H", "L+!H*", "L*+!H", "L+^H*", "L*+^H", "H+L*", "H+!H*", "H+^H*", "!H+!H*", "^H+!H*", "^H+^H*", "H*+L", "!H*+L" }); }
/** * Initialise a HalfPhoneLeftRight feature processor. */ public HalfPhoneLeftRight() { this.values = new ByteStringTranslator(new String[] { "0", "L", "R" }); }
public Pos(String[] posValues) { this.values = new ByteStringTranslator(posValues); this.navigator = new WordNavigator(); this.name = "pos"; }
public PositionType() { values = new ByteStringTranslator(new String[] { "0", "single", "final", "initial", "mid" }); navigator = new SyllableNavigator(); }
/** * Initialize a speaking Style feature processor. */ public Style() { this.values = new ByteStringTranslator(new String[] { "0", "neutral", "poker", "happy", "sad", "angry", "excited" }); this.navigator = new SegmentNavigator(); }
/** * Initialize a speaking Style feature processor. */ public Style() { this.values = new ByteStringTranslator(new String[] { "0", "neutral", "poker", "happy", "sad", "angry", "excited" }); this.navigator = new SegmentNavigator(); }
public WordFrequency(InputStream inStream, String identifier, String encoding) { this.navigator = new WordNavigator(); try { if (inStream != null) this.wordFrequencies = new FSTLookup(inStream, identifier, encoding); else this.wordFrequencies = null; } catch (Exception e) { throw new RuntimeException(e); } this.values = new ByteStringTranslator(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }); }
@Test public void canCreateMaxList() { ByteStringTranslator t = new ByteStringTranslator(ByteStringTranslator.MAXNUM); // (test is that this doesn't throw an exception) }
public WordFrequency(InputStream inStream, String identifier, String encoding) { this.navigator = new WordNavigator(); try { if (inStream != null) this.wordFrequencies = new FSTLookup(inStream, identifier, encoding); else this.wordFrequencies = null; } catch (Exception e) { throw new RuntimeException(e); } this.values = new ByteStringTranslator(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }); }
@Test public void testToStringValues() { String[] values = processor.getValues(); ByteStringTranslator translator = new ByteStringTranslator(values); for (String expected : values) { byte feature = translator.get(expected); FeatureVector vector = new FeatureVector(new byte[] { feature }, new short[] {}, new float[] {}, 0); String actual = computer.toStringValues(vector); assertEquals(expected, actual); } }
@Test public void testToStringValues() { String[] values = processor.getValues(); ByteStringTranslator translator = new ByteStringTranslator(values); for (String expected : values) { byte feature = translator.get(expected); FeatureVector vector = new FeatureVector(new byte[] { feature }, new short[] {}, new float[] {}, 0); String actual = computer.toStringValues(vector); assertEquals(expected, actual); } }