forked from GitHub/gf-core
a few changes in the Nerc that I have forgoten to push
This commit is contained in:
@@ -38,23 +38,27 @@ public class NercLiteralCallback implements LiteralCallback {
|
|||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
String name = sbuilder.toString();
|
String name = sbuilder.toString();
|
||||||
String lemma = null;
|
Expr expr = null;
|
||||||
double prob = 0;
|
double prob = 0;
|
||||||
for (MorphoAnalysis an : concr.lookupMorpho(name)) {
|
for (MorphoAnalysis an : concr.lookupMorpho(name)) {
|
||||||
if ("PN".equals(pgf.getFunctionType(an.getLemma()).getCategory()) &&
|
String cat = pgf.getFunctionType(an.getLemma()).getCategory();
|
||||||
prob < an.getProb()) {
|
if (prob < an.getProb()) {
|
||||||
lemma = an.getLemma();
|
if ("PN".equals(cat)) {
|
||||||
prob = an.getProb();
|
expr = new Expr(an.getLemma(), new Expr[0]);
|
||||||
|
prob = an.getProb();
|
||||||
|
} else if ("Language".equals(cat)) {
|
||||||
|
expr = new Expr(an.getLemma(), new Expr[0]);
|
||||||
|
expr = new Expr("languagePN", expr);
|
||||||
|
} else if ("Pron".equals(cat)) { // to capture I in English
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Expr expr;
|
if (expr == null) {
|
||||||
if (lemma == null) {
|
|
||||||
expr = new Expr(name);
|
expr = new Expr(name);
|
||||||
expr = new Expr("MkSymb", expr);
|
expr = new Expr("MkSymb", expr);
|
||||||
expr = new Expr("SymbPN", expr);
|
expr = new Expr("SymbPN", expr);
|
||||||
} else {
|
|
||||||
expr = new Expr(lemma, new Expr[0]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CallbackResult(new ExprProb(expr, 0), end_offset);
|
return new CallbackResult(new ExprProb(expr, 0), end_offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user