Search in sources :

Example 1 with DefaultMapper

use of edu.stanford.nlp.trees.treebank.DefaultMapper in project CoreNLP by stanfordnlp.

the class FTBDataset method setOptions.

@Override
public boolean setOptions(Properties opts) {
    boolean ret = super.setOptions(opts);
    if (opts.containsKey(ConfigParser.paramSplit)) {
        String splitFileName = opts.getProperty(ConfigParser.paramSplit);
        splitSet = makeSplitSet(splitFileName);
    }
    CC_TAGSET = PropertiesUtils.getBool(opts, ConfigParser.paramCCTagset, false);
    treebank = new MemoryTreebank(new FrenchXMLTreeReaderFactory(CC_TAGSET), FrenchTreebankLanguagePack.FTB_ENCODING);
    if (lexMapper == null) {
        lexMapper = new DefaultMapper();
        lexMapper.setup(null, lexMapOptions.split(","));
    }
    if (pathsToMappings.size() != 0) {
        if (posMapper == null)
            posMapper = new DefaultMapper();
        for (File path : pathsToMappings) posMapper.setup(path);
    }
    return ret;
}
Also used : DefaultMapper(edu.stanford.nlp.trees.treebank.DefaultMapper) FrenchXMLTreeReaderFactory(edu.stanford.nlp.trees.international.french.FrenchXMLTreeReaderFactory) MemoryTreebank(edu.stanford.nlp.trees.MemoryTreebank) File(java.io.File)

Aggregations

MemoryTreebank (edu.stanford.nlp.trees.MemoryTreebank)1 FrenchXMLTreeReaderFactory (edu.stanford.nlp.trees.international.french.FrenchXMLTreeReaderFactory)1 DefaultMapper (edu.stanford.nlp.trees.treebank.DefaultMapper)1 File (java.io.File)1