GitLab Commit is coming up on August 3-4. Learn how to innovate together using GitLab, the DevOps platform. Register for free: gitlabcommitvirtual2021.com

Commit 0b63b3ab authored by Pascal Folleher's avatar Pascal Folleher
Browse files

added CONLL support, use at your own risk;)

parent 72bf26cb
......@@ -97,11 +97,6 @@ public class DatabaseConnection
serialized.mkdir();
Environment env = new Environment(serialized, wrEC);
Database db = env.openDatabase(null, "corpus", wrDC);
logger.warn(db.toString());
logger.warn(db.count());
return db;
}
......@@ -169,11 +164,25 @@ public class DatabaseConnection
}
//TODO: create parse from conll
//ToDO: Prevent NULLPOINTER EXCEPTION
private static void parseCONLL(GrammarEvaluator evaluator, Lexicon lex,
Configuration config, Database db, File f, String s)
Configuration config, Database db, File f, String s) throws IOException
{
throw new RuntimeException();
String sentence = readFileAsString(f.getPath() + "/" + s);
Parse p = Parse.fromConll(sentence);
DecoratedParse dp = null;
if (lex != null)
{
dp = p.decorate(evaluator, lex, config);
}
else
{
dp = p.decorate(evaluator, null, config);
}
addEntryToDB(db, s, dp);
}
static private void parseCDA(GrammarEvaluator evaluator, Lexicon lex,
......@@ -196,8 +205,7 @@ public class DatabaseConnection
else
{
dp = p.decorate(evaluator, null, config);
}
//createCONLLTestData(f.getAbsolutePath(),dp);
}
addEntryToDB(db, s, dp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment