Class IrishSentenceBankDocument
java.lang.Object
opennlp.tools.formats.irishsentencebank.IrishSentenceBankDocument
A structure to hold an Irish Sentence Bank document, which is a collection
of tokenized sentences.
The sentence bank can be downloaded from this website.
It was originally published and described http://www.lexiconista.com/datasets/sentencebank-ga/, yet this page was gone when last checked in December 2022.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<IrishSentenceBankDocument.IrishSentenceBankSentence> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static intadvanceLeft(String s, int start) Helper to adjust the span of punctuation tokens: ignores spaces to the left of the string.private static intadvanceRight(String s, int start) Helper to adjust the span of punctuation tokens: ignores spaces to the right of the string.(package private) static IrishSentenceBankDocumentParses the data provided via aFileinto aIrishSentenceBankDocument.static IrishSentenceBankDocumentparse(InputStream is) Parses the data provided via anInputStreaminto aIrishSentenceBankDocument.
-
Field Details
-
sentences
-
-
Constructor Details
-
IrishSentenceBankDocument
public IrishSentenceBankDocument()Initializes an emptyIrishSentenceBankDocument.
-
-
Method Details
-
add
- Parameters:
sent- AIrishSentenceBankDocument.IrishSentenceBankSentenceto be added.
-
getSentences
- Returns:
- Retrieves an unmodifiable list of all
sentences.
-
advanceLeft
Helper to adjust the span of punctuation tokens: ignores spaces to the left of the string.- Parameters:
s- The string to check.start- The offset of the start of the string.- Returns:
- The offset adjusted to ignore spaces to the left.
-
advanceRight
Helper to adjust the span of punctuation tokens: ignores spaces to the right of the string.- Parameters:
s- The string to check.start- The offset of the start of the string.- Returns:
- The offset of the end of the string, adjusted to ignore spaces to the right.
-
parse
Parses the data provided via anInputStreaminto aIrishSentenceBankDocument.- Parameters:
is- A valid, openInputStreamready for use.- Returns:
- A valid
IrishSentenceBankDocument. - Throws:
IOException- Thrown if IO errors occurred.
-
parse
Parses the data provided via aFileinto aIrishSentenceBankDocument.- Parameters:
file- A validFilethat holds the data to process.- Returns:
- A valid
IrishSentenceBankDocument. - Throws:
IOException- Thrown if IO errors occurred.
-