grammar_cop 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/Rakefile +8 -0
- data/data/.DS_Store +0 -0
- data/data/Makefile +511 -0
- data/data/Makefile.am +4 -0
- data/data/Makefile.in +511 -0
- data/data/de/.DS_Store +0 -0
- data/data/de/4.0.affix +7 -0
- data/data/de/4.0.dict +474 -0
- data/data/de/Makefile +387 -0
- data/data/de/Makefile.am +9 -0
- data/data/de/Makefile.in +387 -0
- data/data/en/.DS_Store +0 -0
- data/data/en/4.0.affix +26 -0
- data/data/en/4.0.batch +1002 -0
- data/data/en/4.0.biolg.batch +411 -0
- data/data/en/4.0.constituent-knowledge +127 -0
- data/data/en/4.0.dict +8759 -0
- data/data/en/4.0.dict.m4 +6928 -0
- data/data/en/4.0.enwiki.batch +14 -0
- data/data/en/4.0.fixes.batch +2776 -0
- data/data/en/4.0.knowledge +306 -0
- data/data/en/4.0.regex +225 -0
- data/data/en/4.0.voa.batch +114 -0
- data/data/en/Makefile +554 -0
- data/data/en/Makefile.am +19 -0
- data/data/en/Makefile.in +554 -0
- data/data/en/README +173 -0
- data/data/en/tiny.dict +157 -0
- data/data/en/words/.DS_Store +0 -0
- data/data/en/words/Makefile +456 -0
- data/data/en/words/Makefile.am +78 -0
- data/data/en/words/Makefile.in +456 -0
- data/data/en/words/currency +205 -0
- data/data/en/words/currency.p +28 -0
- data/data/en/words/entities.given-bisex.sing +39 -0
- data/data/en/words/entities.given-female.sing +4141 -0
- data/data/en/words/entities.given-male.sing +1633 -0
- data/data/en/words/entities.locations.sing +68 -0
- data/data/en/words/entities.national.sing +253 -0
- data/data/en/words/entities.organizations.sing +7 -0
- data/data/en/words/entities.us-states.sing +11 -0
- data/data/en/words/units.1 +45 -0
- data/data/en/words/units.1.dot +4 -0
- data/data/en/words/units.3 +2 -0
- data/data/en/words/units.4 +5 -0
- data/data/en/words/units.4.dot +1 -0
- data/data/en/words/words-medical.adv.1 +1191 -0
- data/data/en/words/words-medical.prep.1 +67 -0
- data/data/en/words/words-medical.v.4.1 +2835 -0
- data/data/en/words/words-medical.v.4.2 +2848 -0
- data/data/en/words/words-medical.v.4.3 +3011 -0
- data/data/en/words/words-medical.v.4.4 +3036 -0
- data/data/en/words/words-medical.v.4.5 +3050 -0
- data/data/en/words/words.adj.1 +6794 -0
- data/data/en/words/words.adj.2 +638 -0
- data/data/en/words/words.adj.3 +667 -0
- data/data/en/words/words.adv.1 +1573 -0
- data/data/en/words/words.adv.2 +67 -0
- data/data/en/words/words.adv.3 +157 -0
- data/data/en/words/words.adv.4 +80 -0
- data/data/en/words/words.n.1 +11464 -0
- data/data/en/words/words.n.1.wiki +264 -0
- data/data/en/words/words.n.2.s +2017 -0
- data/data/en/words/words.n.2.s.biolg +1 -0
- data/data/en/words/words.n.2.s.wiki +298 -0
- data/data/en/words/words.n.2.x +65 -0
- data/data/en/words/words.n.2.x.wiki +10 -0
- data/data/en/words/words.n.3 +5717 -0
- data/data/en/words/words.n.t +23 -0
- data/data/en/words/words.v.1.1 +1038 -0
- data/data/en/words/words.v.1.2 +1043 -0
- data/data/en/words/words.v.1.3 +1052 -0
- data/data/en/words/words.v.1.4 +1023 -0
- data/data/en/words/words.v.1.p +17 -0
- data/data/en/words/words.v.10.1 +14 -0
- data/data/en/words/words.v.10.2 +15 -0
- data/data/en/words/words.v.10.3 +88 -0
- data/data/en/words/words.v.10.4 +17 -0
- data/data/en/words/words.v.2.1 +1253 -0
- data/data/en/words/words.v.2.2 +1304 -0
- data/data/en/words/words.v.2.3 +1280 -0
- data/data/en/words/words.v.2.4 +1285 -0
- data/data/en/words/words.v.2.5 +1287 -0
- data/data/en/words/words.v.4.1 +2472 -0
- data/data/en/words/words.v.4.2 +2487 -0
- data/data/en/words/words.v.4.3 +2441 -0
- data/data/en/words/words.v.4.4 +2478 -0
- data/data/en/words/words.v.4.5 +2483 -0
- data/data/en/words/words.v.5.1 +98 -0
- data/data/en/words/words.v.5.2 +98 -0
- data/data/en/words/words.v.5.3 +103 -0
- data/data/en/words/words.v.5.4 +102 -0
- data/data/en/words/words.v.6.1 +388 -0
- data/data/en/words/words.v.6.2 +401 -0
- data/data/en/words/words.v.6.3 +397 -0
- data/data/en/words/words.v.6.4 +405 -0
- data/data/en/words/words.v.6.5 +401 -0
- data/data/en/words/words.v.8.1 +117 -0
- data/data/en/words/words.v.8.2 +118 -0
- data/data/en/words/words.v.8.3 +118 -0
- data/data/en/words/words.v.8.4 +119 -0
- data/data/en/words/words.v.8.5 +119 -0
- data/data/en/words/words.y +104 -0
- data/data/lt/.DS_Store +0 -0
- data/data/lt/4.0.affix +6 -0
- data/data/lt/4.0.constituent-knowledge +24 -0
- data/data/lt/4.0.dict +135 -0
- data/data/lt/4.0.knowledge +38 -0
- data/data/lt/Makefile +389 -0
- data/data/lt/Makefile.am +11 -0
- data/data/lt/Makefile.in +389 -0
- data/ext/.DS_Store +0 -0
- data/ext/link_grammar/.DS_Store +0 -0
- data/ext/link_grammar/extconf.rb +2 -0
- data/ext/link_grammar/link-grammar/.DS_Store +0 -0
- data/ext/link_grammar/link-grammar/.deps/analyze-linkage.Plo +198 -0
- data/ext/link_grammar/link-grammar/.deps/and.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/api.Plo +244 -0
- data/ext/link_grammar/link-grammar/.deps/build-disjuncts.Plo +212 -0
- data/ext/link_grammar/link-grammar/.deps/command-line.Plo +201 -0
- data/ext/link_grammar/link-grammar/.deps/constituents.Plo +201 -0
- data/ext/link_grammar/link-grammar/.deps/count.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/disjunct-utils.Plo +126 -0
- data/ext/link_grammar/link-grammar/.deps/disjuncts.Plo +123 -0
- data/ext/link_grammar/link-grammar/.deps/error.Plo +121 -0
- data/ext/link_grammar/link-grammar/.deps/expand.Plo +133 -0
- data/ext/link_grammar/link-grammar/.deps/extract-links.Plo +198 -0
- data/ext/link_grammar/link-grammar/.deps/fast-match.Plo +200 -0
- data/ext/link_grammar/link-grammar/.deps/idiom.Plo +200 -0
- data/ext/link_grammar/link-grammar/.deps/jni-client.Plo +217 -0
- data/ext/link_grammar/link-grammar/.deps/link-parser.Po +1 -0
- data/ext/link_grammar/link-grammar/.deps/massage.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/post-process.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/pp_knowledge.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/pp_lexer.Plo +201 -0
- data/ext/link_grammar/link-grammar/.deps/pp_linkset.Plo +200 -0
- data/ext/link_grammar/link-grammar/.deps/prefix.Plo +102 -0
- data/ext/link_grammar/link-grammar/.deps/preparation.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/print-util.Plo +200 -0
- data/ext/link_grammar/link-grammar/.deps/print.Plo +201 -0
- data/ext/link_grammar/link-grammar/.deps/prune.Plo +202 -0
- data/ext/link_grammar/link-grammar/.deps/read-dict.Plo +223 -0
- data/ext/link_grammar/link-grammar/.deps/read-regex.Plo +123 -0
- data/ext/link_grammar/link-grammar/.deps/regex-morph.Plo +131 -0
- data/ext/link_grammar/link-grammar/.deps/resources.Plo +203 -0
- data/ext/link_grammar/link-grammar/.deps/spellcheck-aspell.Plo +1 -0
- data/ext/link_grammar/link-grammar/.deps/spellcheck-hun.Plo +115 -0
- data/ext/link_grammar/link-grammar/.deps/string-set.Plo +198 -0
- data/ext/link_grammar/link-grammar/.deps/tokenize.Plo +160 -0
- data/ext/link_grammar/link-grammar/.deps/utilities.Plo +222 -0
- data/ext/link_grammar/link-grammar/.deps/word-file.Plo +201 -0
- data/ext/link_grammar/link-grammar/.deps/word-utils.Plo +212 -0
- data/ext/link_grammar/link-grammar/.libs/analyze-linkage.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/and.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/api.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/build-disjuncts.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/command-line.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/constituents.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/count.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/disjunct-utils.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/disjuncts.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/error.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/expand.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/extract-links.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/fast-match.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/idiom.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/jni-client.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java-symbols.expsym +31 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java.4.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java.4.dylib.dSYM/Contents/Info.plist +20 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java.4.dylib.dSYM/Contents/Resources/DWARF/liblink-grammar-java.4.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java.a +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-java.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar-symbols.expsym +194 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.4.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.4.dylib.dSYM/Contents/Info.plist +20 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.4.dylib.dSYM/Contents/Resources/DWARF/liblink-grammar.4.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.a +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.dylib +0 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.la +41 -0
- data/ext/link_grammar/link-grammar/.libs/liblink-grammar.lai +41 -0
- data/ext/link_grammar/link-grammar/.libs/massage.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/post-process.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/pp_knowledge.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/pp_lexer.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/pp_linkset.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/prefix.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/preparation.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/print-util.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/print.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/prune.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/read-dict.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/read-regex.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/regex-morph.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/resources.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/spellcheck-aspell.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/spellcheck-hun.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/string-set.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/tokenize.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/utilities.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/word-file.o +0 -0
- data/ext/link_grammar/link-grammar/.libs/word-utils.o +0 -0
- data/ext/link_grammar/link-grammar/Makefile +900 -0
- data/ext/link_grammar/link-grammar/Makefile.am +202 -0
- data/ext/link_grammar/link-grammar/Makefile.in +900 -0
- data/ext/link_grammar/link-grammar/analyze-linkage.c +1317 -0
- data/ext/link_grammar/link-grammar/analyze-linkage.h +24 -0
- data/ext/link_grammar/link-grammar/and.c +1603 -0
- data/ext/link_grammar/link-grammar/and.h +27 -0
- data/ext/link_grammar/link-grammar/api-structures.h +362 -0
- data/ext/link_grammar/link-grammar/api-types.h +72 -0
- data/ext/link_grammar/link-grammar/api.c +1887 -0
- data/ext/link_grammar/link-grammar/api.h +96 -0
- data/ext/link_grammar/link-grammar/autoit/.DS_Store +0 -0
- data/ext/link_grammar/link-grammar/autoit/README +10 -0
- data/ext/link_grammar/link-grammar/autoit/_LGTest.au3 +22 -0
- data/ext/link_grammar/link-grammar/autoit/_LinkGrammar.au3 +545 -0
- data/ext/link_grammar/link-grammar/build-disjuncts.c +487 -0
- data/ext/link_grammar/link-grammar/build-disjuncts.h +21 -0
- data/ext/link_grammar/link-grammar/command-line.c +458 -0
- data/ext/link_grammar/link-grammar/command-line.h +15 -0
- data/ext/link_grammar/link-grammar/constituents.c +1836 -0
- data/ext/link_grammar/link-grammar/constituents.h +26 -0
- data/ext/link_grammar/link-grammar/corpus/.DS_Store +0 -0
- data/ext/link_grammar/link-grammar/corpus/.deps/cluster.Plo +1 -0
- data/ext/link_grammar/link-grammar/corpus/.deps/corpus.Plo +1 -0
- data/ext/link_grammar/link-grammar/corpus/Makefile +527 -0
- data/ext/link_grammar/link-grammar/corpus/Makefile.am +46 -0
- data/ext/link_grammar/link-grammar/corpus/Makefile.in +527 -0
- data/ext/link_grammar/link-grammar/corpus/README +17 -0
- data/ext/link_grammar/link-grammar/corpus/cluster.c +286 -0
- data/ext/link_grammar/link-grammar/corpus/cluster.h +32 -0
- data/ext/link_grammar/link-grammar/corpus/corpus.c +483 -0
- data/ext/link_grammar/link-grammar/corpus/corpus.h +46 -0
- data/ext/link_grammar/link-grammar/count.c +828 -0
- data/ext/link_grammar/link-grammar/count.h +25 -0
- data/ext/link_grammar/link-grammar/disjunct-utils.c +261 -0
- data/ext/link_grammar/link-grammar/disjunct-utils.h +27 -0
- data/ext/link_grammar/link-grammar/disjuncts.c +138 -0
- data/ext/link_grammar/link-grammar/disjuncts.h +13 -0
- data/ext/link_grammar/link-grammar/error.c +92 -0
- data/ext/link_grammar/link-grammar/error.h +35 -0
- data/ext/link_grammar/link-grammar/expand.c +67 -0
- data/ext/link_grammar/link-grammar/expand.h +13 -0
- data/ext/link_grammar/link-grammar/externs.h +22 -0
- data/ext/link_grammar/link-grammar/extract-links.c +625 -0
- data/ext/link_grammar/link-grammar/extract-links.h +16 -0
- data/ext/link_grammar/link-grammar/fast-match.c +309 -0
- data/ext/link_grammar/link-grammar/fast-match.h +17 -0
- data/ext/link_grammar/link-grammar/idiom.c +373 -0
- data/ext/link_grammar/link-grammar/idiom.h +15 -0
- data/ext/link_grammar/link-grammar/jni-client.c +779 -0
- data/ext/link_grammar/link-grammar/jni-client.h +236 -0
- data/ext/link_grammar/link-grammar/liblink-grammar-java.la +42 -0
- data/ext/link_grammar/link-grammar/liblink-grammar.la +41 -0
- data/ext/link_grammar/link-grammar/link-features.h +37 -0
- data/ext/link_grammar/link-grammar/link-features.h.in +37 -0
- data/ext/link_grammar/link-grammar/link-grammar-java.def +31 -0
- data/ext/link_grammar/link-grammar/link-grammar.def +194 -0
- data/ext/link_grammar/link-grammar/link-includes.h +465 -0
- data/ext/link_grammar/link-grammar/link-parser.c +849 -0
- data/ext/link_grammar/link-grammar/massage.c +329 -0
- data/ext/link_grammar/link-grammar/massage.h +13 -0
- data/ext/link_grammar/link-grammar/post-process.c +1113 -0
- data/ext/link_grammar/link-grammar/post-process.h +45 -0
- data/ext/link_grammar/link-grammar/pp_knowledge.c +376 -0
- data/ext/link_grammar/link-grammar/pp_knowledge.h +14 -0
- data/ext/link_grammar/link-grammar/pp_lexer.c +1920 -0
- data/ext/link_grammar/link-grammar/pp_lexer.h +19 -0
- data/ext/link_grammar/link-grammar/pp_linkset.c +158 -0
- data/ext/link_grammar/link-grammar/pp_linkset.h +20 -0
- data/ext/link_grammar/link-grammar/prefix.c +482 -0
- data/ext/link_grammar/link-grammar/prefix.h +139 -0
- data/ext/link_grammar/link-grammar/preparation.c +412 -0
- data/ext/link_grammar/link-grammar/preparation.h +20 -0
- data/ext/link_grammar/link-grammar/print-util.c +87 -0
- data/ext/link_grammar/link-grammar/print-util.h +32 -0
- data/ext/link_grammar/link-grammar/print.c +1085 -0
- data/ext/link_grammar/link-grammar/print.h +16 -0
- data/ext/link_grammar/link-grammar/prune.c +1864 -0
- data/ext/link_grammar/link-grammar/prune.h +17 -0
- data/ext/link_grammar/link-grammar/read-dict.c +1785 -0
- data/ext/link_grammar/link-grammar/read-dict.h +29 -0
- data/ext/link_grammar/link-grammar/read-regex.c +161 -0
- data/ext/link_grammar/link-grammar/read-regex.h +12 -0
- data/ext/link_grammar/link-grammar/regex-morph.c +126 -0
- data/ext/link_grammar/link-grammar/regex-morph.h +17 -0
- data/ext/link_grammar/link-grammar/resources.c +180 -0
- data/ext/link_grammar/link-grammar/resources.h +23 -0
- data/ext/link_grammar/link-grammar/sat-solver/.DS_Store +0 -0
- data/ext/link_grammar/link-grammar/sat-solver/.deps/fast-sprintf.Plo +1 -0
- data/ext/link_grammar/link-grammar/sat-solver/.deps/sat-encoder.Plo +1 -0
- data/ext/link_grammar/link-grammar/sat-solver/.deps/util.Plo +1 -0
- data/ext/link_grammar/link-grammar/sat-solver/.deps/variables.Plo +1 -0
- data/ext/link_grammar/link-grammar/sat-solver/.deps/word-tag.Plo +1 -0
- data/ext/link_grammar/link-grammar/sat-solver/Makefile +527 -0
- data/ext/link_grammar/link-grammar/sat-solver/Makefile.am +29 -0
- data/ext/link_grammar/link-grammar/sat-solver/Makefile.in +527 -0
- data/ext/link_grammar/link-grammar/sat-solver/clock.hpp +33 -0
- data/ext/link_grammar/link-grammar/sat-solver/fast-sprintf.cpp +26 -0
- data/ext/link_grammar/link-grammar/sat-solver/fast-sprintf.hpp +7 -0
- data/ext/link_grammar/link-grammar/sat-solver/guiding.hpp +244 -0
- data/ext/link_grammar/link-grammar/sat-solver/matrix-ut.hpp +79 -0
- data/ext/link_grammar/link-grammar/sat-solver/sat-encoder.cpp +2811 -0
- data/ext/link_grammar/link-grammar/sat-solver/sat-encoder.h +11 -0
- data/ext/link_grammar/link-grammar/sat-solver/sat-encoder.hpp +381 -0
- data/ext/link_grammar/link-grammar/sat-solver/trie.hpp +118 -0
- data/ext/link_grammar/link-grammar/sat-solver/util.cpp +23 -0
- data/ext/link_grammar/link-grammar/sat-solver/util.hpp +14 -0
- data/ext/link_grammar/link-grammar/sat-solver/variables.cpp +5 -0
- data/ext/link_grammar/link-grammar/sat-solver/variables.hpp +829 -0
- data/ext/link_grammar/link-grammar/sat-solver/word-tag.cpp +159 -0
- data/ext/link_grammar/link-grammar/sat-solver/word-tag.hpp +162 -0
- data/ext/link_grammar/link-grammar/spellcheck-aspell.c +148 -0
- data/ext/link_grammar/link-grammar/spellcheck-hun.c +136 -0
- data/ext/link_grammar/link-grammar/spellcheck.h +34 -0
- data/ext/link_grammar/link-grammar/string-set.c +169 -0
- data/ext/link_grammar/link-grammar/string-set.h +16 -0
- data/ext/link_grammar/link-grammar/structures.h +498 -0
- data/ext/link_grammar/link-grammar/tokenize.c +1049 -0
- data/ext/link_grammar/link-grammar/tokenize.h +15 -0
- data/ext/link_grammar/link-grammar/utilities.c +847 -0
- data/ext/link_grammar/link-grammar/utilities.h +281 -0
- data/ext/link_grammar/link-grammar/word-file.c +124 -0
- data/ext/link_grammar/link-grammar/word-file.h +15 -0
- data/ext/link_grammar/link-grammar/word-utils.c +526 -0
- data/ext/link_grammar/link-grammar/word-utils.h +152 -0
- data/ext/link_grammar/link_grammar.c +202 -0
- data/ext/link_grammar/link_grammar.h +99 -0
- data/grammar_cop.gemspec +24 -0
- data/lib/.DS_Store +0 -0
- data/lib/grammar_cop.rb +9 -0
- data/lib/grammar_cop/.DS_Store +0 -0
- data/lib/grammar_cop/dictionary.rb +19 -0
- data/lib/grammar_cop/linkage.rb +30 -0
- data/lib/grammar_cop/parse_options.rb +32 -0
- data/lib/grammar_cop/sentence.rb +36 -0
- data/lib/grammar_cop/version.rb +3 -0
- data/test/.DS_Store +0 -0
- data/test/grammar_cop_test.rb +27 -0
- metadata +407 -0
@@ -0,0 +1,465 @@
|
|
1
|
+
/*************************************************************************/
|
2
|
+
/* Copyright (c) 2004 */
|
3
|
+
/* Daniel Sleator, David Temperley, and John Lafferty */
|
4
|
+
/* All rights reserved */
|
5
|
+
/* */
|
6
|
+
/* Use of the link grammar parsing system is subject to the terms of the */
|
7
|
+
/* license set forth in the LICENSE file included with this software, */
|
8
|
+
/* and also available at http://www.link.cs.cmu.edu/link/license.html */
|
9
|
+
/* This license allows free redistribution and use in source and binary */
|
10
|
+
/* forms, with or without modification, subject to certain conditions. */
|
11
|
+
/* */
|
12
|
+
/*************************************************************************/
|
13
|
+
#ifndef _LINKINCLUDESH_
|
14
|
+
#define _LINKINCLUDESH_
|
15
|
+
|
16
|
+
//#include <link-grammar/link-features.h>
|
17
|
+
#include "link-features.h"
|
18
|
+
|
19
|
+
LINK_BEGIN_DECLS
|
20
|
+
|
21
|
+
/**********************************************************************
|
22
|
+
*
|
23
|
+
* System initialization
|
24
|
+
*
|
25
|
+
***********************************************************************/
|
26
|
+
|
27
|
+
typedef struct Dictionary_s * Dictionary;
|
28
|
+
|
29
|
+
link_public_api(const char *)
|
30
|
+
linkgrammar_get_version(void);
|
31
|
+
|
32
|
+
link_public_api(const char *)
|
33
|
+
linkgrammar_get_dict_version(Dictionary);
|
34
|
+
|
35
|
+
/**********************************************************************
|
36
|
+
*
|
37
|
+
* Functions to manipulate Dictionaries
|
38
|
+
*
|
39
|
+
***********************************************************************/
|
40
|
+
|
41
|
+
link_public_api(Dictionary)
|
42
|
+
dictionary_create(const char * dict_name,
|
43
|
+
const char * pp_name,
|
44
|
+
const char * cons_name,
|
45
|
+
const char * affix_name);
|
46
|
+
link_public_api(Dictionary)
|
47
|
+
dictionary_create_lang(const char * lang);
|
48
|
+
link_public_api(Dictionary)
|
49
|
+
dictionary_create_default_lang(void);
|
50
|
+
|
51
|
+
link_public_api(int)
|
52
|
+
dictionary_delete(Dictionary dict);
|
53
|
+
link_public_api(int)
|
54
|
+
dictionary_get_max_cost(Dictionary dict);
|
55
|
+
|
56
|
+
link_public_api(void)
|
57
|
+
dictionary_set_data_dir(const char * path);
|
58
|
+
link_public_api(char *)
|
59
|
+
dictionary_get_data_dir(void);
|
60
|
+
|
61
|
+
link_public_api(int)
|
62
|
+
dictionary_is_past_tense_form(Dictionary dict, const char * str);
|
63
|
+
link_public_api(int)
|
64
|
+
dictionary_is_entity(Dictionary dict, const char * str);
|
65
|
+
|
66
|
+
/**********************************************************************
|
67
|
+
*
|
68
|
+
* Functions to manipulate Parse Options
|
69
|
+
*
|
70
|
+
***********************************************************************/
|
71
|
+
|
72
|
+
typedef struct Parse_Options_s * Parse_Options;
|
73
|
+
|
74
|
+
link_public_api(Parse_Options)
|
75
|
+
parse_options_create(void);
|
76
|
+
link_public_api(int)
|
77
|
+
parse_options_delete(Parse_Options opts);
|
78
|
+
link_public_api(void)
|
79
|
+
parse_options_set_verbosity(Parse_Options opts, int verbosity);
|
80
|
+
link_public_api(int)
|
81
|
+
parse_options_get_verbosity(Parse_Options opts);
|
82
|
+
link_public_api(void)
|
83
|
+
parse_options_set_linkage_limit(Parse_Options opts, int linkage_limit);
|
84
|
+
link_public_api(int)
|
85
|
+
parse_options_get_linkage_limit(Parse_Options opts);
|
86
|
+
link_public_api(void)
|
87
|
+
parse_options_set_disjunct_cost(Parse_Options opts, int disjunct_cost);
|
88
|
+
link_public_api(void)
|
89
|
+
parse_options_set_disjunct_costf(Parse_Options opts, float disjunct_cost);
|
90
|
+
link_public_api(int)
|
91
|
+
parse_options_get_disjunct_cost(Parse_Options opts);
|
92
|
+
link_public_api(float)
|
93
|
+
parse_options_get_disjunct_costf(Parse_Options opts);
|
94
|
+
link_public_api(void)
|
95
|
+
parse_options_set_min_null_count(Parse_Options opts, int null_count);
|
96
|
+
link_public_api(int)
|
97
|
+
parse_options_get_min_null_count(Parse_Options opts);
|
98
|
+
link_public_api(void)
|
99
|
+
parse_options_set_max_null_count(Parse_Options opts, int null_count);
|
100
|
+
link_public_api(int)
|
101
|
+
parse_options_get_max_null_count(Parse_Options opts);
|
102
|
+
link_public_api(void)
|
103
|
+
parse_options_set_null_block(Parse_Options opts, int null_block);
|
104
|
+
link_public_api(int)
|
105
|
+
parse_options_get_null_block(Parse_Options opts);
|
106
|
+
link_public_api(void)
|
107
|
+
parse_options_set_islands_ok(Parse_Options opts, int islands_ok);
|
108
|
+
link_public_api(int)
|
109
|
+
parse_options_get_islands_ok(Parse_Options opts);
|
110
|
+
link_public_api(void)
|
111
|
+
parse_options_set_spell_guess(Parse_Options opts, int spell_guess);
|
112
|
+
link_public_api(int)
|
113
|
+
parse_options_get_spell_guess(Parse_Options opts);
|
114
|
+
link_public_api(void)
|
115
|
+
parse_options_set_short_length(Parse_Options opts, int short_length);
|
116
|
+
link_public_api(int)
|
117
|
+
parse_options_get_short_length(Parse_Options opts);
|
118
|
+
link_public_api(void)
|
119
|
+
parse_options_set_max_memory(Parse_Options opts, int mem);
|
120
|
+
link_public_api(int)
|
121
|
+
parse_options_get_max_memory(Parse_Options opts);
|
122
|
+
link_public_api(void)
|
123
|
+
parse_options_set_max_sentence_length(Parse_Options opts, int len);
|
124
|
+
link_public_api(int)
|
125
|
+
parse_options_get_max_sentence_length(Parse_Options opts);
|
126
|
+
link_public_api(void)
|
127
|
+
parse_options_set_max_parse_time(Parse_Options opts, int secs);
|
128
|
+
link_public_api(int)
|
129
|
+
parse_options_get_max_parse_time(Parse_Options opts);
|
130
|
+
link_public_api(void)
|
131
|
+
parse_options_set_cost_model_type(Parse_Options opts, int cm);
|
132
|
+
link_public_api(int)
|
133
|
+
parse_options_get_cost_model_type(Parse_Options opts);
|
134
|
+
link_public_api(void)
|
135
|
+
parse_options_set_use_fat_links(Parse_Options opts, int use_fat_links);
|
136
|
+
link_public_api(int)
|
137
|
+
parse_options_get_use_fat_links(Parse_Options opts);
|
138
|
+
link_public_api(void)
|
139
|
+
parse_options_set_use_sat_parser(Parse_Options opts, int use_sat_solver);
|
140
|
+
link_public_api(int)
|
141
|
+
parse_options_get_use_sat_parser(Parse_Options opts);
|
142
|
+
link_public_api(int)
|
143
|
+
parse_options_timer_expired(Parse_Options opts);
|
144
|
+
link_public_api(int)
|
145
|
+
parse_options_memory_exhausted(Parse_Options opts);
|
146
|
+
link_public_api(int)
|
147
|
+
parse_options_resources_exhausted(Parse_Options opts);
|
148
|
+
link_public_api(void)
|
149
|
+
parse_options_set_screen_width(Parse_Options opts, int val);
|
150
|
+
link_public_api(int)
|
151
|
+
parse_options_get_screen_width(Parse_Options opts);
|
152
|
+
link_public_api(void)
|
153
|
+
parse_options_set_allow_null(Parse_Options opts, int val);
|
154
|
+
link_public_api(int)
|
155
|
+
parse_options_get_allow_null(Parse_Options opts);
|
156
|
+
link_public_api(void)
|
157
|
+
parse_options_set_use_cluster_disjuncts(Parse_Options opts, int val);
|
158
|
+
link_public_api(int)
|
159
|
+
parse_options_get_use_cluster_disjuncts(Parse_Options opts);
|
160
|
+
link_public_api(void)
|
161
|
+
parse_options_set_display_walls(Parse_Options opts, int val);
|
162
|
+
link_public_api(int)
|
163
|
+
parse_options_get_display_walls(Parse_Options opts);
|
164
|
+
link_public_api(void)
|
165
|
+
parse_options_set_all_short_connectors(Parse_Options opts, int val);
|
166
|
+
link_public_api(int)
|
167
|
+
parse_options_get_all_short_connectors(Parse_Options opts);
|
168
|
+
link_public_api(void)
|
169
|
+
parse_options_reset_resources(Parse_Options opts);
|
170
|
+
|
171
|
+
|
172
|
+
/**********************************************************************
|
173
|
+
*
|
174
|
+
* The following Parse_Options functions do not directly affect the
|
175
|
+
* operation of the parser, but they can be useful for organizing the
|
176
|
+
* search, or displaying the results. They were included as switches for
|
177
|
+
* convenience in implementing the "standard" version of the link parser
|
178
|
+
* using the API.
|
179
|
+
*
|
180
|
+
***********************************************************************/
|
181
|
+
|
182
|
+
link_public_api(void)
|
183
|
+
parse_options_set_batch_mode(Parse_Options opts, int val);
|
184
|
+
link_public_api(int)
|
185
|
+
parse_options_get_batch_mode(Parse_Options opts);
|
186
|
+
link_public_api(void)
|
187
|
+
parse_options_set_panic_mode(Parse_Options opts, int val);
|
188
|
+
link_public_api(int)
|
189
|
+
parse_options_get_panic_mode(Parse_Options opts);
|
190
|
+
link_public_api(void)
|
191
|
+
parse_options_set_display_on(Parse_Options opts, int val);
|
192
|
+
link_public_api(int)
|
193
|
+
parse_options_get_display_on(Parse_Options opts);
|
194
|
+
link_public_api(void)
|
195
|
+
parse_options_set_display_postscript(Parse_Options opts, int val);
|
196
|
+
link_public_api(int)
|
197
|
+
parse_options_get_display_postscript(Parse_Options opts);
|
198
|
+
link_public_api(void)
|
199
|
+
parse_options_set_display_constituents(Parse_Options opts, int val);
|
200
|
+
link_public_api(int)
|
201
|
+
parse_options_get_display_constituents(Parse_Options opts);
|
202
|
+
link_public_api(void)
|
203
|
+
parse_options_set_display_bad(Parse_Options opts, int val);
|
204
|
+
link_public_api(int)
|
205
|
+
parse_options_get_display_bad(Parse_Options opts);
|
206
|
+
link_public_api(void)
|
207
|
+
parse_options_set_display_disjuncts(Parse_Options opts, int val);
|
208
|
+
link_public_api(int)
|
209
|
+
parse_options_get_display_disjuncts(Parse_Options opts);
|
210
|
+
link_public_api(void)
|
211
|
+
parse_options_set_display_links(Parse_Options opts, int val);
|
212
|
+
link_public_api(int)
|
213
|
+
parse_options_get_display_links(Parse_Options opts);
|
214
|
+
link_public_api(void)
|
215
|
+
parse_options_set_display_senses(Parse_Options opts, int val);
|
216
|
+
link_public_api(int)
|
217
|
+
parse_options_get_display_senses(Parse_Options opts);
|
218
|
+
link_public_api(void)
|
219
|
+
parse_options_set_display_union(Parse_Options opts, int val);
|
220
|
+
link_public_api(int)
|
221
|
+
parse_options_get_display_union(Parse_Options opts);
|
222
|
+
link_public_api(void)
|
223
|
+
parse_options_set_echo_on(Parse_Options opts, int val);
|
224
|
+
link_public_api(int)
|
225
|
+
parse_options_get_echo_on(Parse_Options opts);
|
226
|
+
|
227
|
+
/**********************************************************************
|
228
|
+
*
|
229
|
+
* Functions to manipulate Sentences
|
230
|
+
*
|
231
|
+
***********************************************************************/
|
232
|
+
|
233
|
+
typedef struct Sentence_s * Sentence;
|
234
|
+
|
235
|
+
link_public_api(Sentence)
|
236
|
+
sentence_create(const char *input_string, Dictionary dict);
|
237
|
+
link_public_api(void)
|
238
|
+
sentence_delete(Sentence sent);
|
239
|
+
link_public_api(int)
|
240
|
+
sentence_split(Sentence sent, Parse_Options opts);
|
241
|
+
link_public_api(int)
|
242
|
+
sentence_parse(Sentence sent, Parse_Options opts);
|
243
|
+
link_public_api(int)
|
244
|
+
sentence_length(Sentence sent);
|
245
|
+
link_public_api(const char *)
|
246
|
+
sentence_get_word(Sentence sent, int wordnum);
|
247
|
+
link_public_api(int)
|
248
|
+
sentence_null_count(Sentence sent);
|
249
|
+
link_public_api(int)
|
250
|
+
sentence_num_linkages_found(Sentence sent);
|
251
|
+
link_public_api(int)
|
252
|
+
sentence_num_valid_linkages(Sentence sent);
|
253
|
+
link_public_api(int)
|
254
|
+
sentence_num_linkages_post_processed(Sentence sent);
|
255
|
+
link_public_api(int)
|
256
|
+
sentence_num_thin_linkages(Sentence sent);
|
257
|
+
link_public_api(int)
|
258
|
+
sentence_num_violations(Sentence sent, int i);
|
259
|
+
link_public_api(int)
|
260
|
+
sentence_and_cost(Sentence sent, int i);
|
261
|
+
link_public_api(int)
|
262
|
+
sentence_disjunct_cost(Sentence sent, int i);
|
263
|
+
link_public_api(int)
|
264
|
+
sentence_link_cost(Sentence sent, int i);
|
265
|
+
|
266
|
+
link_public_api(int)
|
267
|
+
sentence_contains_conjunction(Sentence sent);
|
268
|
+
|
269
|
+
/**********************************************************************
|
270
|
+
*
|
271
|
+
* Functions that create and manipulate Linkages.
|
272
|
+
* When a Linkage is requested, the user is given a
|
273
|
+
* copy of all of the necessary information, and is responsible
|
274
|
+
* for freeing up the storage when he/she is finished, using
|
275
|
+
* the routines provided below.
|
276
|
+
*
|
277
|
+
***********************************************************************/
|
278
|
+
|
279
|
+
typedef struct Linkage_s * Linkage;
|
280
|
+
|
281
|
+
link_public_api(Linkage)
|
282
|
+
linkage_create(int index, Sentence sent, Parse_Options opts);
|
283
|
+
link_public_api(int)
|
284
|
+
linkage_get_current_sublinkage(Linkage linkage);
|
285
|
+
link_public_api(int)
|
286
|
+
linkage_set_current_sublinkage(Linkage linkage, int index);
|
287
|
+
link_public_api(void)
|
288
|
+
linkage_delete(Linkage linkage);
|
289
|
+
link_public_api(Sentence)
|
290
|
+
linkage_get_sentence(Linkage linkage);
|
291
|
+
link_public_api(int)
|
292
|
+
linkage_get_num_sublinkages(Linkage linkage);
|
293
|
+
link_public_api(int)
|
294
|
+
linkage_get_num_words(Linkage linkage);
|
295
|
+
link_public_api(int)
|
296
|
+
linkage_get_num_links(Linkage linkage);
|
297
|
+
link_public_api(int)
|
298
|
+
linkage_get_link_lword(Linkage linkage, int index);
|
299
|
+
link_public_api(int)
|
300
|
+
linkage_get_link_rword(Linkage linkage, int index);
|
301
|
+
link_public_api(int)
|
302
|
+
linkage_get_link_length(Linkage linkage, int index);
|
303
|
+
link_public_api(const char *)
|
304
|
+
linkage_get_link_label(Linkage linkage, int index);
|
305
|
+
link_public_api(const char *)
|
306
|
+
linkage_get_link_llabel(Linkage linkage, int index);
|
307
|
+
link_public_api(const char *)
|
308
|
+
linkage_get_link_rlabel(Linkage linkage, int index);
|
309
|
+
link_public_api(int)
|
310
|
+
linkage_get_link_num_domains(Linkage linkage, int index);
|
311
|
+
link_public_api(const char **)
|
312
|
+
linkage_get_link_domain_names(Linkage linkage, int index);
|
313
|
+
link_public_api(const char **)
|
314
|
+
linkage_get_words(Linkage linkage);
|
315
|
+
link_public_api(const char *)
|
316
|
+
linkage_get_disjunct_str(Linkage linkage, int w);
|
317
|
+
link_public_api(double)
|
318
|
+
linkage_get_disjunct_cost(Linkage linkage, int w);
|
319
|
+
link_public_api(double)
|
320
|
+
linkage_get_disjunct_corpus_score(Linkage linkage, int w);
|
321
|
+
link_public_api(const char *)
|
322
|
+
linkage_get_word(Linkage linkage, int w);
|
323
|
+
link_public_api(char *)
|
324
|
+
linkage_print_disjuncts(Linkage linkage);
|
325
|
+
link_public_api(void)
|
326
|
+
linkage_free_disjuncts(char *str);
|
327
|
+
link_public_api(char *)
|
328
|
+
linkage_print_links_and_domains(Linkage linkage);
|
329
|
+
link_public_api(void)
|
330
|
+
linkage_free_links_and_domains(char *str);
|
331
|
+
link_public_api(char *)
|
332
|
+
linkage_print_senses(Linkage linkage);
|
333
|
+
link_public_api(void)
|
334
|
+
linkage_free_senses(char *str);
|
335
|
+
link_public_api(char *)
|
336
|
+
linkage_print_constituent_tree(Linkage linkage, int mode);
|
337
|
+
link_public_api(void)
|
338
|
+
linkage_free_constituent_tree_str(char *str);
|
339
|
+
link_public_api(char *)
|
340
|
+
linkage_print_postscript(Linkage linkage, int mode);
|
341
|
+
link_public_api(void)
|
342
|
+
linkage_free_postscript(char * str);
|
343
|
+
link_public_api(char *)
|
344
|
+
linkage_print_diagram(Linkage linkage);
|
345
|
+
link_public_api(void)
|
346
|
+
linkage_free_diagram(char * str);
|
347
|
+
link_public_api(int)
|
348
|
+
linkage_compute_union(Linkage linkage);
|
349
|
+
link_public_api(int)
|
350
|
+
linkage_is_fat(Linkage linkage);
|
351
|
+
link_public_api(int)
|
352
|
+
linkage_unused_word_cost(Linkage linkage);
|
353
|
+
link_public_api(int)
|
354
|
+
linkage_disjunct_cost(Linkage linkage);
|
355
|
+
link_public_api(int)
|
356
|
+
linkage_and_cost(Linkage linkage);
|
357
|
+
link_public_api(int)
|
358
|
+
linkage_link_cost(Linkage linkage);
|
359
|
+
link_public_api(double)
|
360
|
+
linkage_corpus_cost(Linkage linkage);
|
361
|
+
link_public_api(int)
|
362
|
+
linkage_is_canonical(Linkage linkage);
|
363
|
+
link_public_api(int)
|
364
|
+
linkage_is_improper(Linkage linkage);
|
365
|
+
link_public_api(int)
|
366
|
+
linkage_has_inconsistent_domains(Linkage linkage);
|
367
|
+
link_public_api(const char *)
|
368
|
+
linkage_get_violation_name(Linkage linkage);
|
369
|
+
|
370
|
+
|
371
|
+
/**********************************************************************
|
372
|
+
*
|
373
|
+
* Functions that allow special-purpose post-processing of linkages
|
374
|
+
*
|
375
|
+
***********************************************************************/
|
376
|
+
|
377
|
+
typedef struct Postprocessor_s PostProcessor;
|
378
|
+
|
379
|
+
link_public_api(PostProcessor *)
|
380
|
+
post_process_open(const char *path);
|
381
|
+
link_public_api(void)
|
382
|
+
post_process_close(PostProcessor *);
|
383
|
+
link_public_api(void)
|
384
|
+
linkage_post_process(Linkage, PostProcessor *);
|
385
|
+
|
386
|
+
/**********************************************************************
|
387
|
+
*
|
388
|
+
* Constituent node
|
389
|
+
*
|
390
|
+
***********************************************************************/
|
391
|
+
|
392
|
+
typedef struct CNode_s CNode;
|
393
|
+
|
394
|
+
link_public_api(CNode *)
|
395
|
+
linkage_constituent_tree(Linkage linkage);
|
396
|
+
link_public_api(void)
|
397
|
+
linkage_free_constituent_tree(CNode * n);
|
398
|
+
link_public_api(const char *)
|
399
|
+
linkage_constituent_node_get_label(const CNode *n);
|
400
|
+
link_public_api(CNode *)
|
401
|
+
linkage_constituent_node_get_child(const CNode *n);
|
402
|
+
link_public_api(CNode *)
|
403
|
+
linkage_constituent_node_get_next(const CNode *n);
|
404
|
+
link_public_api(int)
|
405
|
+
linkage_constituent_node_get_start(const CNode *n);
|
406
|
+
link_public_api(int)
|
407
|
+
linkage_constituent_node_get_end(const CNode *n);
|
408
|
+
|
409
|
+
/**********************************************************************
|
410
|
+
*
|
411
|
+
* Internal functions -- do not use these in new code!
|
412
|
+
* These are not intended for general public use, but are required to
|
413
|
+
* work around certain Micorsoft Windows linking oddities
|
414
|
+
* (specifically, to be callable from the JNI bindings library.)
|
415
|
+
*
|
416
|
+
***********************************************************************/
|
417
|
+
|
418
|
+
link_public_api(void)
|
419
|
+
parse_options_print_total_time(Parse_Options opts);
|
420
|
+
|
421
|
+
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
422
|
+
#define GNUC_PRINTF( format_idx, arg_idx ) \
|
423
|
+
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
424
|
+
#else
|
425
|
+
#define GNUC_PRINTF( format_idx, arg_idx )
|
426
|
+
#endif
|
427
|
+
|
428
|
+
link_public_api(void)
|
429
|
+
prt_error(const char *fmt, ...) GNUC_PRINTF(1,2);
|
430
|
+
|
431
|
+
/*******************************************************
|
432
|
+
*
|
433
|
+
* Obsolete functions -- do not use these in new code!
|
434
|
+
* XXX TBD: These will all go away in Version 5.0.
|
435
|
+
*
|
436
|
+
********************************************************/
|
437
|
+
|
438
|
+
/* Identical to sentence_get_word()
|
439
|
+
* XXX TBD: make this go away in Version 5.0. */
|
440
|
+
link_public_api(const char *)
|
441
|
+
sentence_get_nth_word(Sentence sent, int i);
|
442
|
+
|
443
|
+
/* Who uses this function, anyway? How did this get exported?
|
444
|
+
* XXX TBD: make this go away in Version 5.0. */
|
445
|
+
link_public_api(int)
|
446
|
+
sentence_nth_word_has_disjunction(Sentence sent, int i);
|
447
|
+
|
448
|
+
/* This is not intended for general use; its specific to the internals
|
449
|
+
* of the command-line client. It was exported by accident.
|
450
|
+
* XXX TBD: make this go away in Version 5.0. */
|
451
|
+
link_public_api(int)
|
452
|
+
issue_special_command(const char * line, Parse_Options opts, Dictionary dict);
|
453
|
+
|
454
|
+
/* These are obsolete, and do nothing.
|
455
|
+
* XXX TBD: make these go away in Version 5.0. */
|
456
|
+
link_public_api(void)
|
457
|
+
lperror_clear(void);
|
458
|
+
extern link_public_api(int)
|
459
|
+
lperrno;
|
460
|
+
extern link_public_api(char)
|
461
|
+
lperrmsg[];
|
462
|
+
|
463
|
+
LINK_END_DECLS
|
464
|
+
|
465
|
+
#endif
|