org.schwiebert.abl4j.data
Class DataFactory
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
DataFactory
public DataFactory()
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)
© 2007 Stephan Schwiebert