edu.cmu.minorthird.text.learn.experiments
Class MonotonicSubTextLabels

java.lang.Object
  extended by edu.cmu.minorthird.text.learn.experiments.SubTextLabels
      extended by edu.cmu.minorthird.text.learn.experiments.MonotonicSubTextLabels
All Implemented Interfaces:
MonotonicTextLabels, TextLabels, Visible

public class MonotonicSubTextLabels
extends SubTextLabels
implements MonotonicTextLabels

A subset of another TextLabels that can be added to. Additions are propogated back to the underlying MonotonicTextLabels passed in as an argument.

Author:
William Cohen

Field Summary
 
Fields inherited from class edu.cmu.minorthird.text.learn.experiments.SubTextLabels
labels, subBase
 
Constructor Summary
MonotonicSubTextLabels(SubTextBase subBase, MonotonicTextLabels labels)
           
 
Method Summary
 void addToType(Span span, java.lang.String type)
          Assert that a span has a given type.
 void addToType(Span span, java.lang.String type, Details details)
          Assert that a span has a given type, and associate that assertion with some detailed information.
 void declareType(java.lang.String type)
          Declare a new type, without asserting any spans as members.
 void defineDictionary(java.lang.String dictName, java.util.List<java.lang.String> fileNames, boolean ignoreCase)
          Associate a dictionary from this file
 void defineDictionary(java.lang.String dictName, java.util.Set<java.lang.String> dict)
          Associate a dictionary with this labeling.
 void defineTrie(java.util.List<java.lang.String> phraseList)
          Define a trie
 AnnotatorLoader getAnnotatorLoader()
          Get the current AnnotatorLoader.
 Trie getTrie()
          Return a trie if defined
 void require(java.lang.String annotationType, java.lang.String fileToLoad)
          Ensure that this TextLabels contains a particular type of annotation.
 void require(java.lang.String annotationType, java.lang.String fileToLoad, AnnotatorLoader loader)
          Ensure that this TextLabels contains a particular type of annotation.
 void setAnnotatorLoader(AnnotatorLoader newLoader)
          Specify the AnnotatorLoader used to find Annotations when a 'require' call is made.
 void setProperty(Span span, java.lang.String prop, java.lang.String value)
          Assert that Span span has the given value of the given property
 void setProperty(Span span, java.lang.String prop, java.lang.String value, Details details)
          Assert that Span span has the given value of the given property, and associate that with some detailed information
 void setProperty(Token token, java.lang.String prop, java.lang.String value)
          Assert that TextToken textToken has the given value of the given property.
 void setProperty(Token token, java.lang.String prop, java.lang.String value, Details details)
          Assert that a token has a given property value, and associate that with some detailed information.
 
Methods inherited from class edu.cmu.minorthird.text.learn.experiments.SubTextLabels
annotateWith, closureIterator, closureIterator, getDetails, getProperty, getProperty, getSpanProperties, getSpansWithProperty, getSpansWithProperty, getTextBase, getTokenProperties, getTypes, getTypeSet, hasDictionary, hasType, inDict, instanceIterator, instanceIterator, isAnnotatedBy, isType, setAnnotatedBy, showTokenProp, toGUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.cmu.minorthird.text.MonotonicTextLabels
setAnnotatedBy
 
Methods inherited from interface edu.cmu.minorthird.text.TextLabels
annotateWith, closureIterator, closureIterator, getDetails, getProperty, getProperty, getSpanProperties, getSpansWithProperty, getSpansWithProperty, getTextBase, getTokenProperties, getTypes, getTypeSet, hasDictionary, hasType, inDict, instanceIterator, instanceIterator, isAnnotatedBy, isType, showTokenProp
 

Constructor Detail

MonotonicSubTextLabels

public MonotonicSubTextLabels(SubTextBase subBase,
                              MonotonicTextLabels labels)
Method Detail

setAnnotatorLoader

public void setAnnotatorLoader(AnnotatorLoader newLoader)
Description copied from interface: MonotonicTextLabels
Specify the AnnotatorLoader used to find Annotations when a 'require' call is made.

Specified by:
setAnnotatorLoader in interface MonotonicTextLabels

getAnnotatorLoader

public AnnotatorLoader getAnnotatorLoader()
Description copied from interface: MonotonicTextLabels
Get the current AnnotatorLoader.

Specified by:
getAnnotatorLoader in interface MonotonicTextLabels

defineDictionary

public void defineDictionary(java.lang.String dictName,
                             java.util.Set<java.lang.String> dict)
Description copied from interface: MonotonicTextLabels
Associate a dictionary with this labeling.

Specified by:
defineDictionary in interface MonotonicTextLabels

defineDictionary

public void defineDictionary(java.lang.String dictName,
                             java.util.List<java.lang.String> fileNames,
                             boolean ignoreCase)
Associate a dictionary from this file

Specified by:
defineDictionary in interface MonotonicTextLabels

getTrie

public Trie getTrie()
Return a trie if defined

Specified by:
getTrie in interface MonotonicTextLabels

defineTrie

public void defineTrie(java.util.List<java.lang.String> phraseList)
Define a trie

Specified by:
defineTrie in interface MonotonicTextLabels

setProperty

public void setProperty(Token token,
                        java.lang.String prop,
                        java.lang.String value)
Description copied from interface: MonotonicTextLabels
Assert that TextToken textToken has the given value of the given property.

Specified by:
setProperty in interface MonotonicTextLabels

setProperty

public void setProperty(Token token,
                        java.lang.String prop,
                        java.lang.String value,
                        Details details)
Description copied from interface: MonotonicTextLabels
Assert that a token has a given property value, and associate that with some detailed information. If details==null, this should have the same effect as setProperty(span,prop,value).

Specified by:
setProperty in interface MonotonicTextLabels

setProperty

public void setProperty(Span span,
                        java.lang.String prop,
                        java.lang.String value)
Description copied from class: SubTextLabels
Assert that Span span has the given value of the given property

Specified by:
setProperty in interface MonotonicTextLabels
Overrides:
setProperty in class SubTextLabels

setProperty

public void setProperty(Span span,
                        java.lang.String prop,
                        java.lang.String value,
                        Details details)
Description copied from interface: MonotonicTextLabels
Assert that Span span has the given value of the given property, and associate that with some detailed information

Specified by:
setProperty in interface MonotonicTextLabels

addToType

public void addToType(Span span,
                      java.lang.String type)
Description copied from interface: MonotonicTextLabels
Assert that a span has a given type.

Specified by:
addToType in interface MonotonicTextLabels

addToType

public void addToType(Span span,
                      java.lang.String type,
                      Details details)
Description copied from interface: MonotonicTextLabels
Assert that a span has a given type, and associate that assertion with some detailed information. If details==null, this should have the same effect as addToType(span,type).

Specified by:
addToType in interface MonotonicTextLabels

declareType

public void declareType(java.lang.String type)
Description copied from interface: MonotonicTextLabels
Declare a new type, without asserting any spans as members.

Specified by:
declareType in interface MonotonicTextLabels

require

public void require(java.lang.String annotationType,
                    java.lang.String fileToLoad)
Description copied from interface: TextLabels
Ensure that this TextLabels contains a particular type of annotation. If the annotation is not present, then either load it (if possible) or throw an error.

Specified by:
require in interface TextLabels
Overrides:
require in class SubTextLabels

require

public void require(java.lang.String annotationType,
                    java.lang.String fileToLoad,
                    AnnotatorLoader loader)
Description copied from interface: TextLabels
Ensure that this TextLabels contains a particular type of annotation. If the annotation is not present, then either load it (if possible) or throw an error. Use the provided annotatorLoader to find annotators rather than the default one.

Specified by:
require in interface TextLabels
Overrides:
require in class SubTextLabels