GrammarScope  4.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
grammarscope.document.SegmentedDocument Class Reference
Inheritance diagram for grammarscope.document.SegmentedDocument:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.document.SegmentedDocument:
Collaboration graph
[legend]

Public Member Functions

void segment ()
 
String getText ()
 
int getSentenceCount ()
 
List< WordSegmentgetWords ()
 
List< SentenceSegmentgetSentences ()
 
List< Segmentsplit (final Segment leftSegment, final Segment rightSegment)
 
List< Segmentsplit (final Segment segment)
 
String getPath ()
 
String getString (final Segment segment)
 
SentenceSegment getSentenceSegment (final int sentenceIndex)
 
int nextSentence ()
 
int previousSentence ()
 
void setSentenceIdx (final int sentenceIdx)
 
int getCurrentSentenceIdx ()
 
SentenceSegment getCurrentSentenceSegment ()
 
String toString ()
 

Static Public Member Functions

static Segment merge (final List< Segment > segments)
 
static Segment merge (final Segment... segments)
 
static String sentenceToString (final List< Segment > sentence, final int lineLen)
 

Protected Member Functions

 SegmentedDocument (final IDocumentFactory documentFactory, final URL url, final String text)
 

Protected Attributes

final URL url
 
String text
 
boolean isSegmented
 

Private Attributes

final IDocumentFactory documentFactory
 
List< WordSegmentwords
 
List< SentenceSegmentsentences
 
int currentSentenceIdx
 

Constructor & Destructor Documentation

◆ SegmentedDocument()

grammarscope.document.SegmentedDocument.SegmentedDocument ( final IDocumentFactory  documentFactory,
final URL  url,
final String  text 
)
protected

Constructor

Parameters
documentFactorydocument factory
urldocument url
textdocument text

Member Function Documentation

◆ getCurrentSentenceIdx()

int grammarscope.document.SegmentedDocument.getCurrentSentenceIdx ( )

◆ getCurrentSentenceSegment()

SentenceSegment grammarscope.document.SegmentedDocument.getCurrentSentenceSegment ( )

◆ getPath()

String grammarscope.document.SegmentedDocument.getPath ( )

Get document path

Returns
document path

◆ getSentenceCount()

int grammarscope.document.SegmentedDocument.getSentenceCount ( )

◆ getSentences()

List<SentenceSegment> grammarscope.document.SegmentedDocument.getSentences ( )

◆ getSentenceSegment()

SentenceSegment grammarscope.document.SegmentedDocument.getSentenceSegment ( final int  sentenceIndex)

Get current sentence

Parameters
sentenceIndexsentence index
Returns
current sentence

◆ getString()

String grammarscope.document.SegmentedDocument.getString ( final Segment  segment)

Get segment string

Parameters
segmentsegment
Returns
string for segment

◆ getText()

String grammarscope.document.SegmentedDocument.getText ( )

◆ getWords()

List<WordSegment> grammarscope.document.SegmentedDocument.getWords ( )

◆ merge() [1/2]

static Segment grammarscope.document.SegmentedDocument.merge ( final List< Segment segments)
static

Merge segments to segment

Parameters
segmentssegments
Returns
segment

◆ merge() [2/2]

static Segment grammarscope.document.SegmentedDocument.merge ( final Segment...  segments)
static

Merge segments to segment

Parameters
segmentssegments
Returns
segment

◆ nextSentence()

int grammarscope.document.SegmentedDocument.nextSentence ( )

◆ previousSentence()

int grammarscope.document.SegmentedDocument.previousSentence ( )

◆ segment()

void grammarscope.document.SegmentedDocument.segment ( )

Segment

◆ sentenceToString()

static String grammarscope.document.SegmentedDocument.sentenceToString ( final List< Segment sentence,
final int  lineLen 
)
static

Convert sentence to string

Parameters
sentencesentence
lineLenline length to wrap at
Returns
sentence string

◆ setSentenceIdx()

void grammarscope.document.SegmentedDocument.setSentenceIdx ( final int  sentenceIdx)

◆ split() [1/2]

List<Segment> grammarscope.document.SegmentedDocument.split ( final Segment  leftSegment,
final Segment  rightSegment 
)

Make intermediate segment list

Parameters
leftSegmentstart segment
rightSegmentfinish segment
Returns
list of segments

◆ split() [2/2]

List<Segment> grammarscope.document.SegmentedDocument.split ( final Segment  segment)

Split segment into word segments

Parameters
segmentsegment
Returns
list of word segments

◆ toString()

String grammarscope.document.SegmentedDocument.toString ( )

Member Data Documentation

◆ currentSentenceIdx

int grammarscope.document.SegmentedDocument.currentSentenceIdx
private

Current sentence index

◆ documentFactory

final IDocumentFactory grammarscope.document.SegmentedDocument.documentFactory
private

◆ isSegmented

boolean grammarscope.document.SegmentedDocument.isSegmented
protected

Original text

◆ sentences

List<SentenceSegment> grammarscope.document.SegmentedDocument.sentences
private

Sentences

◆ text

String grammarscope.document.SegmentedDocument.text
protected

Original text

◆ url

final URL grammarscope.document.SegmentedDocument.url
protected

Document URL

◆ words

List<WordSegment> grammarscope.document.SegmentedDocument.words
private

Words


The documentation for this class was generated from the following file: