ABL4J (Alignment Based Learning for Java) - 0.9.7

org.schwiebert.abl4j.data
Class DataFactory

java.lang.Object
  extended by org.schwiebert.abl4j.data.DataFactory

public class DataFactory
extends Object

The DataFactory defines which implementations of IWord, ISentence etc are used - see initialize(PropertiesMap) for details.

Author:
sschwieb
See Also:
AblProperties, ABLInitializer

Field Summary
private static InheritableThreadLocal<Class> constituentClass
           
private static Logger logger
           
private static InheritableThreadLocal<Class> sentenceClass
           
private static InheritableThreadLocal<IWordMapping> threadLocalMapping
           
private static InheritableThreadLocal<Class> treeBank
           
private static InheritableThreadLocal<Class> treeClass
           
private static InheritableThreadLocal<Class> wordClass
           
 
Constructor Summary
DataFactory()
           
 
Method Summary
static IWordMapping getMapping()
           
static IWord getWord(Object data)
          This procedure associates to each unique space and newline delimited input string, a word, a unique number for internal representation and stores this in the Word class.
static void initialize(PropertiesMap propertiesMap)
          Initializes the DataFactory with the given PropertiesMap.
static IConstituent newConstituent()
           
static IConstituent newConstituent(ISentence sentence, int begin, int end)
           
static ISentence newSentence()
           
static ITree newTree()
           
static ITreeBank newTreeBank()
           
static IWord newWord(int index)
          Creates a new word which will be registered within a WordMapping.
static void setMapping(IWordMapping wordMapping)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static Logger logger

threadLocalMapping

private static InheritableThreadLocal<IWordMapping> threadLocalMapping

constituentClass

private static InheritableThreadLocal<Class> constituentClass

sentenceClass

private static InheritableThreadLocal<Class> sentenceClass

wordClass

private static InheritableThreadLocal<Class> wordClass

treeClass

private static InheritableThreadLocal<Class> treeClass

treeBank

private static InheritableThreadLocal<Class> treeBank
Constructor Detail

DataFactory

public DataFactory()
Method Detail

initialize

public static void initialize(PropertiesMap propertiesMap)
                       throws ClassNotFoundException
Initializes the DataFactory with the given PropertiesMap. The classes that will be used within ABL4J (implementations of IConstituent, ISentence, IWord, ITree and ITreeBank) are loaded here. These classes can be set by modifying the Properties AblProperties.CONSTITUENT_CLASS, AblProperties.SENTENCE_CLASS, AblProperties.WORD_CLASS, AblProperties.TREE_CLASS and AblProperties.TREEBANK_CLASS . The ABL4J-Implementation (found in org.schwiebert.abl4j.data) will be used by default.

Parameters:
propertiesMap - the properties map
Throws:
ClassNotFoundException - if one of the data classes cannot be loaded

getMapping

public static IWordMapping getMapping()

getWord

public static IWord getWord(Object data)
This procedure associates to each unique space and newline delimited input string, a word, a unique number for internal representation and stores this in the Word class.


newConstituent

public static IConstituent newConstituent()

newConstituent

public static IConstituent newConstituent(ISentence sentence,
                                          int begin,
                                          int end)

newTree

public static ITree newTree()

newSentence

public static ISentence newSentence()

newWord

public static IWord newWord(int index)
Creates a new word which will be registered within a WordMapping.

Parameters:
index -
Returns:

newTreeBank

public static ITreeBank newTreeBank()

setMapping

public static void setMapping(IWordMapping wordMapping)

ABL4J (Alignment Based Learning for Java) - 0.9.7

© 2007 Stephan Schwiebert