omorfi 0.9.9
Open morphology of Finnish
Public Member Functions | Static Public Member Functions | Data Fields
omorfi.doc.Doc Class Reference

Public Member Functions

def __init__ (self)
 
def __getitem__ (self, index)
 
def __str__ (self)
 
def get_sentence (self, index)
 
def add (self, tokens)
 
def write (self, f)
 

Static Public Member Functions

def read (f)
 

Data Fields

 tokens
 underlying raw omor analysis
 
 sents
 sentences
 

Detailed Description

Doc contains tokens consisting a text or corpus.

Doc is typically e.g. one file tokenised and/or parsed. Contains tokens,
which make up sentences and stuff.

Constructor & Destructor Documentation

◆ __init__()

def omorfi.doc.Doc.__init__ (   self)
Create an empty document

Member Function Documentation

◆ __getitem__()

def omorfi.doc.Doc.__getitem__ (   self,
  index 
)
Just pick token from the list.

◆ add()

def omorfi.doc.Doc.add (   self,
  tokens 
)
Add tokens to the documentation.

Adds sentences if they are separated by proper nontokens.

◆ get_sentence()

def omorfi.doc.Doc.get_sentence (   self,
  index 
)
Get a sentence from doc.

If doc contains nontokens separating sentences...

◆ read()

def omorfi.doc.Doc.read (   f)
static
Reads self from a file-like object.

◆ write()

def omorfi.doc.Doc.write (   self,
  f 
)
Writes self in some format into a file-like object.

Experimental.

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