ipipan.spejd.entities
Class Segment

java.lang.Object
  extended by ipipan.spejd.entities.Entity
      extended by ipipan.spejd.entities.Segment
Direct Known Subclasses:
Word

public class Segment
extends Entity

A representation of segment - the smallest interpreted unit, ie. a sequence of characters together with their morphosyntactic interpretations.


Field Summary
 
Fields inherited from class ipipan.spejd.entities.Entity
ARRAY, GROUP, NOSPACE, NULL, SEGMENT, TOKEN, WORD
 
Constructor Summary
Segment()
           
Segment(java.lang.String id, java.lang.String orth, Interpretation[] interp)
           
 
Method Summary
 void add(boolean delOld, java.lang.String[] data)
          Add interpretations, optionally deleting old ones.
 void delete(java.util.regex.Pattern pattern, boolean neg)
          Delete all interpretations matching / not matching specified pattern.
 java.lang.String getAttr(int id)
          Returns orthographic form of the token or base form (lemma) of the first interpretation.
 Interpretation[] getInterpretationArray()
          Get the set of interpretations.
 java.util.Set<Interpretation> getInterpretations()
          Get the set of interpretations.
 Segment getSemHead()
          Get semantic head of an entity.
 Segment getSynHead()
          Get syntactic head of an entity.
 void printXML(java.io.PrintStream out)
          Prints the XML (XCES) representation of entity on the given PrintStream.
 
Methods inherited from class ipipan.spejd.entities.Entity
concatAttr, concatAttr, getCommonValues, getGroupType, getId, getReplacement, setReplacement, setRule, toTxt, unify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Segment

public Segment()

Segment

public Segment(java.lang.String id,
               java.lang.String orth,
               Interpretation[] interp)
Method Detail

add

public void add(boolean delOld,
                java.lang.String[] data)
Description copied from class: Entity
Add interpretations, optionally deleting old ones.

Overrides:
add in class Entity

delete

public void delete(java.util.regex.Pattern pattern,
                   boolean neg)
Description copied from class: Entity
Delete all interpretations matching / not matching specified pattern.

Overrides:
delete in class Entity

getAttr

public java.lang.String getAttr(int id)
Returns orthographic form of the token or base form (lemma) of the first interpretation.

Overrides:
getAttr in class Entity
Parameters:
id - Attribute.ORTH or Attribute.BASE
Returns:
orthographic or base form for segments and words, empty string for groups and special entities (ns, sb, se).

getSemHead

public Segment getSemHead()
Description copied from class: Entity
Get semantic head of an entity.

Overrides:
getSemHead in class Entity
Returns:
semantic head of a group, null otherwise

getSynHead

public Segment getSynHead()
Description copied from class: Entity
Get syntactic head of an entity.

Overrides:
getSynHead in class Entity
Returns:
semantic head of a group, null otherwise

getInterpretations

public java.util.Set<Interpretation> getInterpretations()
Description copied from class: Entity
Get the set of interpretations.

Overrides:
getInterpretations in class Entity
Returns:
a set of interpretations for segments and words, null for groups and special entities (ns, sb, se).

getInterpretationArray

public Interpretation[] getInterpretationArray()
Description copied from class: Entity
Get the set of interpretations.

Overrides:
getInterpretationArray in class Entity
Returns:
a set of interpretations for segments and words, null for groups and special entities (ns, sb, se).

printXML

public void printXML(java.io.PrintStream out)
Description copied from class: Entity
Prints the XML (XCES) representation of entity on the given PrintStream.

Specified by:
printXML in class Entity