public class HyphenTextModifierImpl extends Object implements TextModifier
Constructor and Description |
---|
HyphenTextModifierImpl(InputStream hyphenfilename,
int windowSize)
Default constructor takes a name of the file containing hyphenated
phrases, with their frequency.
|
HyphenTextModifierImpl(String hyphenfilename,
int windowSize) |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args)
Simple tests of
TextModification
Output expected: UNSUPPORTED: TextModification with offset changes. UNSUPPORTED: TextModification with offset changes. UNSUPPORTED: TextModification with offset changes. Orig: Non Hodgkin's the x ray without any non small cell complications. New: (new text not generated, see previous messages) Non-Hodgkin Orig: 0-12 New: 0-11 x-ray Orig: 19-25 New: 18-23 non-small-cell Orig: 38-53 New: 36-50 Orig: Non Hodgkin's the x ray without any non small cell complications. New: Non-Hodgkin's the x-ray without any non-small-cell complications. Non-Hodgkin Orig: 0-11 New: 0-11 x-ray Orig: 18-23 New: 18-23 non-small-cell Orig: 36-50 New: 36-50 Note the case of the words doesn't matter. |
TextModification[] |
modify(String in)
Generates modifications for the specified text.
|
static ArrayList<String> |
test(HyphenTextModifierImpl tm,
String text) |
public HyphenTextModifierImpl(String hyphenfilename, int windowSize)
public HyphenTextModifierImpl(InputStream hyphenfilename, int windowSize)
public TextModification[] modify(String in) throws Exception
TextModifier
modify
in interface TextModifier
in
- Original document text.Exception
public static ArrayList<String> test(HyphenTextModifierImpl tm, String text)
public static void main(String[] args)
TextModification
args
- hyphen text filename (each line: hyphenated-word|freq)Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.