mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-10 05:29:30 -06:00
added fullFormLexicon in Java
This commit is contained in:
@@ -1107,8 +1107,11 @@ Java_org_grammaticalframework_pgf_Lexicon_lookupWordPrefix
|
||||
GuPool* pool = gu_new_pool();
|
||||
GuExn* err = gu_new_exn(pool);
|
||||
|
||||
GuEnum* en = pgf_lookup_word_prefix(get_ref(env, jconcr), j2gu_string(env, prefix, pool),
|
||||
pool, err);
|
||||
GuEnum* en =
|
||||
(prefix == NULL) ? pgf_fullform_lexicon(get_ref(env, jconcr),
|
||||
pool)
|
||||
: pgf_lookup_word_prefix(get_ref(env, jconcr), j2gu_string(env, prefix, pool),
|
||||
pool, err);
|
||||
if (!gu_ok(err)) {
|
||||
if (gu_exn_caught(err, PgfExn)) {
|
||||
GuString msg = (GuString) gu_exn_caught_data(err);
|
||||
|
||||
@@ -70,7 +70,9 @@ public class Concr {
|
||||
public native List<MorphoAnalysis> lookupMorpho(String sentence);
|
||||
|
||||
/** Creates an iterable over the full form lexicon in the grammar */
|
||||
public native Iterable<FullFormEntry> fullFormLexicon();
|
||||
public Iterable<FullFormEntry> fullFormLexicon() {
|
||||
return new Lexicon(this, null);
|
||||
}
|
||||
|
||||
/** Returns an iterable enumerating all words in the lexicon
|
||||
* starting with a given prefix.
|
||||
|
||||
Reference in New Issue
Block a user