public class ContractionsPTB extends Object
Constructor and Description |
---|
ContractionsPTB() |
Modifier and Type | Method and Description |
---|---|
static ContractionResult |
getLengthIfNextApostIsMiddleOfContraction(int position,
int nextNonLetterDigit,
String lowerCasedText)
Determine if the text starting at 'position' within 'text' is the start of a
contraction such as "should've" or "hasn't" or "it's" by looking at whether
there is a letter before the apostrophe, and the appropriate letters after the
apostrophe (or in the case of "n't", verify the letter before is an 'n'
Note that if the text starting at 'position' is something like "n't" which
isn't a complete word, returns null.
|
static void |
main(String[] args) |
public static ContractionResult getLengthIfNextApostIsMiddleOfContraction(int position, int nextNonLetterDigit, String lowerCasedText)
position
- first char of next tokenlowerCasedText
- text into which parameter position is an index intofor handling contractions like "cannot" that don't have an apostrophe
public static void main(String[] args)
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.