From 05c5685ad29a054ff38ad897e126cfd12369bc5a Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Sun, 25 Nov 2018 18:22:47 -0500 Subject: [PATCH] New upstream version 5.5.1 --- ChangeLog | 9 + Makefile.am | 36 +- Makefile.in | 36 +- NEWS | 48 + README.md | 28 +- bindings/java/Makefile.am | 5 + bindings/java/Makefile.in | 31 +- bindings/perl/clinkgrammar.pm | 5192 ----------------- bindings/python-examples/Makefile.am | 5 + bindings/python-examples/Makefile.in | 5 + bindings/python-examples/README.md | 4 +- bindings/python-examples/lg_testutils.py | 4 +- bindings/python-examples/parses-demo-sql.txt | 19 + bindings/python-examples/parses-en.txt | 8 +- bindings/python-examples/parses-pos-en.txt | 56 + bindings/python-examples/parses-pos-he.txt | 12 + bindings/python-examples/parses-pos-ru.txt | 12 + .../python-examples/parses-pos-spell-en.txt | 23 + bindings/python-examples/parses-sat-en.txt | 2 +- bindings/python-examples/sentence-check.py | 132 +- bindings/python-examples/tests.py | 197 +- bindings/python/__init__.py | 2 +- bindings/python/clinkgrammar.py | 8 + bindings/python/lg_python_wrap.cc | 47 + bindings/python/linkgrammar.py | 2 + bindings/python3/__init__.py | 2 +- bindings/python3/clinkgrammar.py | 8 + bindings/python3/lg_python_wrap.cc | 47 + bindings/swig/link_grammar.i | 17 +- configure | 27 +- configure.ac | 9 +- data/command-help-en.txt | 204 +- data/demo-sql/Makefile.am | 5 +- data/demo-sql/Makefile.in | 83 +- data/demo-sql/dict.db | Bin 8192 -> 24576 bytes data/en/4.0.affix | 7 +- data/en/4.0.dict | 855 ++- data/en/4.0.dict.m4 | 537 +- data/en/4.0.knowledge | 6 +- data/en/4.0.regex | 3 + data/en/Makefile.in | 2 +- data/en/corpus-basic.batch | 5 +- data/en/corpus-fixes.batch | 266 +- data/en/missing | 8 - data/en/words/words-medical.v.4.1 | 1 - data/en/words/words-medical.v.4.2 | 1 - data/en/words/words-medical.v.4.3 | 1 - data/en/words/words-medical.v.4.4 | 1 - data/en/words/words-medical.v.4.5 | 1 - data/en/words/words.adj.1-const | 2 + data/en/words/words.adj.1-vowel | 3 + data/en/words/words.adv.1 | 2 + data/en/words/words.n.1-const | 76 +- data/en/words/words.n.1-vowel | 9 + data/en/words/words.n.2.s | 8 +- data/en/words/words.n.3-const | 14 + data/en/words/words.n.t | 68 +- data/en/words/words.v.1.1 | 2 +- data/en/words/words.v.1.2 | 2 +- data/en/words/words.v.1.3 | 2 +- data/en/words/words.v.1.4 | 2 +- data/en/words/words.v.1.p | 2 + data/en/words/words.v.10.1 | 18 + data/en/words/words.v.10.2 | 18 + data/en/words/words.v.10.3 | 19 + data/en/words/words.v.10.4 | 18 + data/en/words/words.v.2.1 | 1 - data/en/words/words.v.2.2 | 1 - data/en/words/words.v.2.3 | 1 - data/en/words/words.v.2.4 | 1 - data/en/words/words.v.2.5 | 1 - data/en/words/words.v.4.1 | 2 +- data/en/words/words.v.4.2 | 2 +- data/en/words/words.v.4.3 | 2 +- data/en/words/words.v.4.4 | 2 +- data/en/words/words.v.4.5 | 2 +- data/en/words/words.v.8.1 | 1 + data/en/words/words.v.8.2 | 1 + data/en/words/words.v.8.3 | 1 + data/en/words/words.v.8.4 | 1 + data/en/words/words.v.8.5 | 1 + data/fa/README | 3 + data/he/4.0.dict.m4 | 461 ++ data/he/Makefile.am | 1 + data/he/Makefile.in | 1 + debug/README.md | 217 + link-grammar.spec | 2 +- link-grammar/Makefile.am | 4 - link-grammar/Makefile.in | 20 +- link-grammar/api-structures.h | 16 +- link-grammar/api.c | 12 + link-grammar/connectors.c | 217 +- link-grammar/connectors.h | 98 +- link-grammar/dict-common/dict-common.h | 12 +- link-grammar/dict-common/dict-impl.c | 10 +- link-grammar/dict-common/print-dict.c | 57 +- link-grammar/dict-file/dictionary.c | 28 +- link-grammar/dict-file/read-dict.h | 5 +- link-grammar/dict-sql/README.md | 5 + link-grammar/dict-sql/demo.sql | 8 +- link-grammar/dict-sql/read-sql.c | 41 +- link-grammar/disjunct-utils.c | 29 +- link-grammar/disjunct-utils.h | 8 +- link-grammar/link-features.h | 6 +- link-grammar/link-grammar.def | 2 - link-grammar/link-includes.h | 2 + link-grammar/linkage/linkage.c | 104 +- link-grammar/linkage/sane.c | 2 +- link-grammar/minisat/LICENSE | 21 + link-grammar/minisat/Makefile.am | 2 +- link-grammar/minisat/Makefile.in | 2 +- link-grammar/parse/count.c | 4 +- link-grammar/parse/prune.c | 23 +- link-grammar/post-process/constituents.c | 1 + link-grammar/post-process/pp-structures.h | 1 + link-grammar/post-process/pp_knowledge.c | 2 + link-grammar/prepare/build-disjuncts.c | 93 +- link-grammar/prepare/exprune.c | 3 +- link-grammar/print/print-util.c | 14 +- link-grammar/print/print.c | 6 +- link-grammar/sat-solver/sat-encoder.cpp | 75 +- link-grammar/sat-solver/word-tag.cpp | 28 +- link-grammar/sat-solver/word-tag.hpp | 40 +- link-grammar/utilities.h | 4 - link-parser/command-line.c | 34 +- link-parser/link-parser.c | 67 +- {msvc14 => msvc}/LGlib-features.props | 0 {msvc14 => msvc}/LinkGrammar.sln | 12 +- {msvc14 => msvc}/LinkGrammar.vcxproj | 46 +- {msvc14 => msvc}/LinkGrammar.vcxproj.filters | 8 +- {msvc14 => msvc}/LinkGrammarExe.vcxproj | 12 +- .../LinkGrammarExe.vcxproj.filters | 0 {msvc14 => msvc}/LinkGrammarJava.vcxproj | 12 +- .../LinkGrammarJava.vcxproj.filters | 0 {msvc14 => msvc}/Local.props | 0 {msvc14 => msvc}/MSVC-common.props | 1 + {msvc14 => msvc}/Python2.vcxproj | 23 +- {msvc14 => msvc}/Python2.vcxproj.filters | 5 - msvc/Python3.vcxproj | 269 + {msvc14 => msvc}/Python3.vcxproj.filters | 7 +- {msvc14 => msvc}/README.md | 6 +- {msvc14 => msvc}/confvar.bat | 0 {msvc14 => msvc}/make-check.py | 0 {msvc14 => msvc}/post-build.bat | 0 144 files changed, 3958 insertions(+), 6538 deletions(-) create mode 100644 bindings/python-examples/parses-demo-sql.txt create mode 100644 bindings/python-examples/parses-pos-en.txt create mode 100644 bindings/python-examples/parses-pos-he.txt create mode 100644 bindings/python-examples/parses-pos-ru.txt create mode 100644 bindings/python-examples/parses-pos-spell-en.txt delete mode 100644 data/en/missing create mode 100644 data/he/4.0.dict.m4 create mode 100644 debug/README.md create mode 100644 link-grammar/minisat/LICENSE rename {msvc14 => msvc}/LGlib-features.props (100%) rename {msvc14 => msvc}/LinkGrammar.sln (90%) rename {msvc14 => msvc}/LinkGrammar.vcxproj (91%) rename {msvc14 => msvc}/LinkGrammar.vcxproj.filters (96%) rename {msvc14 => msvc}/LinkGrammarExe.vcxproj (95%) rename {msvc14 => msvc}/LinkGrammarExe.vcxproj.filters (100%) rename {msvc14 => msvc}/LinkGrammarJava.vcxproj (95%) rename {msvc14 => msvc}/LinkGrammarJava.vcxproj.filters (100%) rename {msvc14 => msvc}/Local.props (100%) rename {msvc14 => msvc}/MSVC-common.props (87%) rename {msvc14 => msvc}/Python2.vcxproj (94%) rename {msvc14 => msvc}/Python2.vcxproj.filters (86%) create mode 100644 msvc/Python3.vcxproj rename {msvc14 => msvc}/Python3.vcxproj.filters (86%) rename {msvc14 => msvc}/README.md (95%) rename {msvc14 => msvc}/confvar.bat (100%) rename {msvc14 => msvc}/make-check.py (100%) rename {msvc14 => msvc}/post-build.bat (100%) diff --git a/ChangeLog b/ChangeLog index 93a652e..ab902f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Version 5.5.1 (27 July 2018) + * Fix broken Java bindings build. + * English dict: Fix clause openers with questions. + * English dict: Various misc fixes. + * English dict: Various paraphrasing verbs + * Bring the SQL-backed dict to production state. + * Convert MSVC build to MSVC15 (Visual Studio 2017). + * Restore the repeatability of the produced linkages. + Version 5.5.0 (29 April 2018) * Fix accidental API breakage that impacts OpenCog. * Fix memory leak when parsing with null links. diff --git a/Makefile.am b/Makefile.am index 19a3a19..c4cde07 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,29 +27,31 @@ EXTRA_DIST = \ MAINTAINERS \ NEWS \ README.md \ + debug/README.md \ docker/docker-build.sh \ docker/docker-base/Dockerfile \ docker/docker-parser/Dockerfile \ docker/docker-python/Dockerfile \ docker/docker-server/Dockerfile \ m4/varcheckpoint.m4 \ - msvc14/LGlib-features.props \ - msvc14/LinkGrammarExe.vcxproj \ - msvc14/LinkGrammarExe.vcxproj.filters \ - msvc14/LinkGrammarJava.vcxproj \ - msvc14/LinkGrammarJava.vcxproj.filters \ - msvc14/LinkGrammar.sln \ - msvc14/LinkGrammar.vcxproj \ - msvc14/LinkGrammar.vcxproj.filters \ - msvc14/Local.props \ - msvc14/confvar.bat \ - msvc14/MSVC-common.props \ - msvc14/post-build.bat \ - msvc14/Python2.vcxproj \ - msvc14/Python2.vcxproj.filters \ - msvc14/Python3.vcxproj.filters \ - msvc14/README.md \ - msvc14/make-check.py \ + msvc/LGlib-features.props \ + msvc/LinkGrammarExe.vcxproj \ + msvc/LinkGrammarExe.vcxproj.filters \ + msvc/LinkGrammarJava.vcxproj \ + msvc/LinkGrammarJava.vcxproj.filters \ + msvc/LinkGrammar.sln \ + msvc/LinkGrammar.vcxproj \ + msvc/LinkGrammar.vcxproj.filters \ + msvc/Local.props \ + msvc/confvar.bat \ + msvc/MSVC-common.props \ + msvc/post-build.bat \ + msvc/Python2.vcxproj \ + msvc/Python3.vcxproj \ + msvc/Python2.vcxproj.filters \ + msvc/Python3.vcxproj.filters \ + msvc/README.md \ + msvc/make-check.py \ mingw/README-Cygwin.md \ mingw/README-MSYS.md \ mingw/README-MSYS2.md \ diff --git a/Makefile.in b/Makefile.in index 7c9ecb8..d2155d3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -448,29 +448,31 @@ EXTRA_DIST = \ MAINTAINERS \ NEWS \ README.md \ + debug/README.md \ docker/docker-build.sh \ docker/docker-base/Dockerfile \ docker/docker-parser/Dockerfile \ docker/docker-python/Dockerfile \ docker/docker-server/Dockerfile \ m4/varcheckpoint.m4 \ - msvc14/LGlib-features.props \ - msvc14/LinkGrammarExe.vcxproj \ - msvc14/LinkGrammarExe.vcxproj.filters \ - msvc14/LinkGrammarJava.vcxproj \ - msvc14/LinkGrammarJava.vcxproj.filters \ - msvc14/LinkGrammar.sln \ - msvc14/LinkGrammar.vcxproj \ - msvc14/LinkGrammar.vcxproj.filters \ - msvc14/Local.props \ - msvc14/confvar.bat \ - msvc14/MSVC-common.props \ - msvc14/post-build.bat \ - msvc14/Python2.vcxproj \ - msvc14/Python2.vcxproj.filters \ - msvc14/Python3.vcxproj.filters \ - msvc14/README.md \ - msvc14/make-check.py \ + msvc/LGlib-features.props \ + msvc/LinkGrammarExe.vcxproj \ + msvc/LinkGrammarExe.vcxproj.filters \ + msvc/LinkGrammarJava.vcxproj \ + msvc/LinkGrammarJava.vcxproj.filters \ + msvc/LinkGrammar.sln \ + msvc/LinkGrammar.vcxproj \ + msvc/LinkGrammar.vcxproj.filters \ + msvc/Local.props \ + msvc/confvar.bat \ + msvc/MSVC-common.props \ + msvc/post-build.bat \ + msvc/Python2.vcxproj \ + msvc/Python3.vcxproj \ + msvc/Python2.vcxproj.filters \ + msvc/Python3.vcxproj.filters \ + msvc/README.md \ + msvc/make-check.py \ mingw/README-Cygwin.md \ mingw/README-MSYS.md \ mingw/README-MSYS2.md \ diff --git a/NEWS b/NEWS index cd4ef02..4d2a4e7 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,51 @@ +[ANNOUNCE] Link-Grammar Version 5.5.0 is now available. + +Version 5.5.0 of link-grammar has been released. It contains several +important bug-fixes for opencog users. + +* The previous version accidentally broke the opencog API. This version + fixes it. + +* Linkages generated by the "ANY" random parser were not actually being + randomized. This is now fixed. (Bug reported by Andres.) + +* Poorly-formated dictionaries no longer report errors. (Bug reported + by Alexei/Anton) + +The complete list of changes is: + + * Fix accidental API breakage that impacts OpenCog. + * Fix memory leak when parsing with null links. + * Python bindings: Add an optional parse-option argument to parse(). + * Add an extended version API and use it in "link-parser --version". + * Fix spurious errors if the last dict line is a comment. + * Fix garbage report if EOF encountered in a quoted dict word. + * Fix garbage report if whitespace encountered in a quoted dict word. + * Add a per-command help in link-parser. + * Add a command line completion in link-parser. + * Enable build of word-graph printing support by default. + * Add idiom lookup in link-parser's dict lookup command (!!idiom_here). + * Improve handling of quoted words (e.g. single words in "scare + * quotes"). + * Fix random selection of linkages so that it's actually random. + +You can download link-grammar from +http://www.abisource.com/downloads/link-grammar/current/ + +The website is here: +https://www.abisource.com/projects/link-grammar/ + +WHAT IS LINK GRAMMER? +The Link Grammar Parser is a syntactic parser of English (and other +languages as well), based on Link Grammar, an original theory of English +syntax. Given a sentence, the system assigns to it a syntactic structure, +which consists of a set of labelled links connecting pairs of words. + + +================================================================= +================================================================= +================================================================= + [ANNOUNCE] Link-Grammar Version 5.4.4 is now available. I'm pleased to announce that version 5.4.4 is now available. I don't diff --git a/README.md b/README.md index 62c777c..ebabb8a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Link Grammar Parser =================== -***Version 5.5.0*** +***Version 5.5.1*** The Link Grammar Parser implements the Sleator/Temperley/Lafferty theory of natural language parsing. This version of the parser is @@ -169,7 +169,7 @@ Contents | configure | The GNU configuration script | | autogen.sh | Developer's configure maintenance tool | | debug/ | Information for debugging the library | -| msvc14/ | Microsoft Visual-C project files | +| msvc/ | Microsoft Visual-C project files | | mingw/ | Information on using MinGW under MSYS or Cygwin | UNPACKING and signature verification @@ -186,7 +186,7 @@ corruption of the dataset during download, and to help ensure that no malicious changes were made to the code internals by third parties. The signatures can be checked with the gpg command: -`gpg --verify link-grammar-5.5.0.tar.gz.asc` +`gpg --verify link-grammar-5.5.1.tar.gz.asc` which should generate output identical to (except for the date): ``` @@ -201,7 +201,7 @@ verify the check-sums, issue `md5sum -c MD5SUM` at the command line. Tags in `git` can be verified by performing the following: ``` gpg --recv-keys --keyserver keyserver.ubuntu.com EB6AA534E0C0651C -git tag -v link-grammar-5.5.0 +git tag -v link-grammar-5.5.1 ``` @@ -477,8 +477,8 @@ See [mingw/README-Cygwin.md](mingw/README-Cygwin.md). BUILDING and RUNNING on Windows (MSVC) -------------------------------------- -Microsoft Visual C/C++ project files can be found in the msvc14 directory. -For directions see the [README.md](msvc14/README.md) file there. +Microsoft Visual C/C++ project files can be found in the `msvc` directory. +For directions see the [README.md](msvc/README.md) file there. RUNNING the program ------------------- @@ -956,6 +956,9 @@ but this `Js` link crosses (clashes with - marked by xxx) the link to the conjunction. These two cases suggest that one should allow most links to cross over the down-links to conjunctions. +This is currently worked-around by splitting the Js link into two: +a Jj part and a Jk part; the two are used together to cross over +the conjunction. Type Theory @@ -1407,6 +1410,10 @@ http://www.corpus.bham.ac.uk/publications/index.shtml edited by Elena Tognini-Bonelli, volume 4), 2000
[Book review](http://www.aclweb.org/anthology/J01-2013). + “The Molecular Level of Lexical Semantics”, EA Nida, (1997) + International Journal of Lexicography, 10(4): 265–274. + [Online](https://www.academia.edu/36534355/The_Molecular_Level_of_Lexical_Semantics_by_EA_Nida) + ### "holes" in collocations (aka "set phrases" of "phrasemes"): The link-grammar provides several mechanisms to support circumpositions or even more complicated multi-word structures. @@ -1534,6 +1541,11 @@ http://www.phon.ucl.ac.uk/home/dick/enc2010/articles/relative-clause.htm mutual information content, they can dominate the syntactic structure of a sentence. +### Preposition linking: + The current parse of "he wanted to look at and listen to everything." + is inadequate: the link to "everything" needs to connect to "and", so + that "listen to" and "look at" are treated as atomic verb phrases. + ### Lexical functions: MTT suggests that perhaps the correct way to understand the contents of the post-processing rules is as an implementation of 'lexical @@ -1574,11 +1586,13 @@ analysis. To quote Wikipedia: > "tower". ### Morphology printing: - Instead of hard-coding LL, declare which links are morpho links in the dict. ### UTF-8 cleanup: + Hmm. Is this really needed? UTF-8 seems to work well, now. So maybe + leave it alone. + Replace the mbrtowc code with proper language support; it seems that the correct solution is to use [ICU](http://site.icu-project.org/) * ICU pros: runs on windows. diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am index 5d6ac5d..646a51c 100644 --- a/bindings/java/Makefile.am +++ b/bindings/java/Makefile.am @@ -45,6 +45,11 @@ install-data-hook: uninstall-hook: -rm ${DESTDIR}${javadir}/linkgrammar.jar +dist-hook: +if HAVE_ANT + : # Validate that the bindings can actually be created + zipinfo $(java_DATA) org/linkgrammar/LinkGrammar.class >/dev/null +endif EXTRA_DIST = \ README \ diff --git a/bindings/java/Makefile.in b/bindings/java/Makefile.in index b4204c0..90a733b 100644 --- a/bindings/java/Makefile.in +++ b/bindings/java/Makefile.in @@ -459,6 +459,9 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook check-am: all-am check: check-am all-am: Makefile $(DATA) @@ -496,8 +499,8 @@ clean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -@HAVE_ANT_FALSE@clean-local: @HAVE_ANT_FALSE@distclean-local: +@HAVE_ANT_FALSE@clean-local: clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am @@ -569,17 +572,17 @@ uninstall-am: uninstall-javaDATA .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am distclean distclean-generic \ - distclean-libtool distclean-local distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-data-hook install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-javaDATA install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am uninstall-hook \ + clean-local cscopelist-am ctags-am dist-hook distclean \ + distclean-generic distclean-libtool distclean-local distdir \ + dvi dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-hook install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-javaDATA \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-hook \ uninstall-javaDATA .PRECIOUS: Makefile @@ -606,6 +609,10 @@ install-data-hook: uninstall-hook: -rm ${DESTDIR}${javadir}/linkgrammar.jar +dist-hook: +@HAVE_ANT_TRUE@ : # Validate that the bindings can actually be created +@HAVE_ANT_TRUE@ zipinfo $(java_DATA) org/linkgrammar/LinkGrammar.class >/dev/null + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/bindings/perl/clinkgrammar.pm b/bindings/perl/clinkgrammar.pm index 49f665a..091f779 100644 --- a/bindings/perl/clinkgrammar.pm +++ b/bindings/perl/clinkgrammar.pm @@ -191,5195 +191,3 @@ package clinkgrammar; *SINGLE_LINE = *clinkgrammarc::SINGLE_LINE; *MAX_STYLES = *clinkgrammarc::MAX_STYLES; 1; -WIG_ERROR) ? r : SWIG_TypeError) - -/* The CastRankLimit says how many bits are used for the cast rank */ -#define SWIG_CASTRANKLIMIT (1 << 8) -/* The NewMask denotes the object was created (using new/malloc) */ -#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) -/* The TmpMask is for in/out typemaps that use temporal objects */ -#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) -/* Simple returning values */ -#define SWIG_BADOBJ (SWIG_ERROR) -#define SWIG_OLDOBJ (SWIG_OK) -#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) -#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) -/* Check, add and del mask methods */ -#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) -#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) -#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) -#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) -#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) -#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) - -/* Cast-Rank Mode */ -#if defined(SWIG_CASTRANK_MODE) -# ifndef SWIG_TypeRank -# define SWIG_TypeRank unsigned long -# endif -# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ -# define SWIG_MAXCASTRANK (2) -# endif -# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) -# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { - return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; -} -SWIGINTERNINLINE int SWIG_CheckState(int r) { - return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; -} -#else /* no cast-rank mode */ -# define SWIG_AddCast(r) (r) -# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) -#endif - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *(*swig_converter_func)(void *, int *); -typedef struct swig_type_info *(*swig_dycast_func)(void **); - -/* Structure to store information on one type */ -typedef struct swig_type_info { - const char *name; /* mangled name of this type */ - const char *str; /* human readable name of this type */ - swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ - struct swig_cast_info *cast; /* linked list of types that can cast into this type */ - void *clientdata; /* language specific type data */ - int owndata; /* flag if the structure owns the clientdata */ -} swig_type_info; - -/* Structure to store a type and conversion function used for casting */ -typedef struct swig_cast_info { - swig_type_info *type; /* pointer to type that is equivalent to this type */ - swig_converter_func converter; /* function to cast the void pointers */ - struct swig_cast_info *next; /* pointer to next cast in linked list */ - struct swig_cast_info *prev; /* pointer to the previous cast */ -} swig_cast_info; - -/* Structure used to store module information - * Each module generates one structure like this, and the runtime collects - * all of these structures and stores them in a circularly linked list.*/ -typedef struct swig_module_info { - swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ - size_t size; /* Number of types in this module */ - struct swig_module_info *next; /* Pointer to next element in circularly linked list */ - swig_type_info **type_initial; /* Array of initially generated type structures */ - swig_cast_info **cast_initial; /* Array of initially generated casting structures */ - void *clientdata; /* Language specific module data */ -} swig_module_info; - -/* - Compare two type names skipping the space characters, therefore - "char*" == "char *" and "Class" == "Class", etc. - - Return 0 when the two name types are equivalent, as in - strncmp, but skipping ' '. -*/ -SWIGRUNTIME int -SWIG_TypeNameComp(const char *f1, const char *l1, - const char *f2, const char *l2) { - for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { - while ((*f1 == ' ') && (f1 != l1)) ++f1; - while ((*f2 == ' ') && (f2 != l2)) ++f2; - if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; - } - return (int)((l1 - f1) - (l2 - f2)); -} - -/* - Check type equivalence in a name list like ||... - Return 0 if equal, -1 if nb < tb, 1 if nb > tb -*/ -SWIGRUNTIME int -SWIG_TypeCmp(const char *nb, const char *tb) { - int equiv = 1; - const char* te = tb + strlen(tb); - const char* ne = nb; - while (equiv != 0 && *ne) { - for (nb = ne; *ne; ++ne) { - if (*ne == '|') break; - } - equiv = SWIG_TypeNameComp(nb, ne, tb, te); - if (*ne) ++ne; - } - return equiv; -} - -/* - Check type equivalence in a name list like ||... - Return 0 if not equal, 1 if equal -*/ -SWIGRUNTIME int -SWIG_TypeEquiv(const char *nb, const char *tb) { - return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; -} - -/* - Check the typename -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(iter->type->name, c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison -*/ -SWIGRUNTIME swig_cast_info * -SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (iter->type == from) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* - Cast a pointer up an inheritance hierarchy -*/ -SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); -} - -/* - Dynamic pointer casting. Down an inheritance hierarchy -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { - swig_type_info *lastty = ty; - if (!ty || !ty->dcast) return ty; - while (ty && (ty->dcast)) { - ty = (*ty->dcast)(ptr); - if (ty) lastty = ty; - } - return lastty; -} - -/* - Return the name associated with this type -*/ -SWIGRUNTIMEINLINE const char * -SWIG_TypeName(const swig_type_info *ty) { - return ty->name; -} - -/* - Return the pretty name associated with this type, - that is an unmangled type name in a form presentable to the user. -*/ -SWIGRUNTIME const char * -SWIG_TypePrettyName(const swig_type_info *type) { - /* The "str" field contains the equivalent pretty names of the - type, separated by vertical-bar characters. We choose - to print the last name, as it is often (?) the most - specific. */ - if (!type) return NULL; - if (type->str != NULL) { - const char *last_name = type->str; - const char *s; - for (s = type->str; *s; s++) - if (*s == '|') last_name = s+1; - return last_name; - } - else - return type->name; -} - -/* - Set the clientdata field for a type -*/ -SWIGRUNTIME void -SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { - swig_cast_info *cast = ti->cast; - /* if (ti->clientdata == clientdata) return; */ - ti->clientdata = clientdata; - - while (cast) { - if (!cast->converter) { - swig_type_info *tc = cast->type; - if (!tc->clientdata) { - SWIG_TypeClientData(tc, clientdata); - } - } - cast = cast->next; - } -} -SWIGRUNTIME void -SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { - SWIG_TypeClientData(ti, clientdata); - ti->owndata = 1; -} - -/* - Search for a swig_type_info structure only by mangled name - Search is a O(log #types) - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_MangledTypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - swig_module_info *iter = start; - do { - if (iter->size) { - size_t l = 0; - size_t r = iter->size - 1; - do { - /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - size_t i = (l + r) >> 1; - const char *iname = iter->types[i]->name; - if (iname) { - int compare = strcmp(name, iname); - if (compare == 0) { - return iter->types[i]; - } else if (compare < 0) { - if (i) { - r = i - 1; - } else { - break; - } - } else if (compare > 0) { - l = i + 1; - } - } else { - break; /* should never happen */ - } - } while (l <= r); - } - iter = iter->next; - } while (iter != end); - return 0; -} - -/* - Search for a swig_type_info structure for either a mangled name or a human readable name. - It first searches the mangled names of the types, which is a O(log #types) - If a type is not found it then searches the human readable names, which is O(#types). - - We start searching at module start, and finish searching when start == end. - Note: if start == end at the beginning of the function, we go all the way around - the circular list. -*/ -SWIGRUNTIME swig_type_info * -SWIG_TypeQueryModule(swig_module_info *start, - swig_module_info *end, - const char *name) { - /* STEP 1: Search the name field using binary search */ - swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); - if (ret) { - return ret; - } else { - /* STEP 2: If the type hasn't been found, do a complete search - of the str field (the human readable name) */ - swig_module_info *iter = start; - do { - size_t i = 0; - for (; i < iter->size; ++i) { - if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) - return iter->types[i]; - } - iter = iter->next; - } while (iter != end); - } - - /* neither found a match */ - return 0; -} - -/* - Pack binary data into a string -*/ -SWIGRUNTIME char * -SWIG_PackData(char *c, void *ptr, size_t sz) { - static const char hex[17] = "0123456789abcdef"; - const unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - unsigned char uu = *u; - *(c++) = hex[(uu & 0xf0) >> 4]; - *(c++) = hex[uu & 0xf]; - } - return c; -} - -/* - Unpack binary data from a string -*/ -SWIGRUNTIME const char * -SWIG_UnpackData(const char *c, void *ptr, size_t sz) { - unsigned char *u = (unsigned char *) ptr; - const unsigned char *eu = u + sz; - for (; u != eu; ++u) { - char d = *(c++); - unsigned char uu; - if ((d >= '0') && (d <= '9')) - uu = (unsigned char)((d - '0') << 4); - else if ((d >= 'a') && (d <= 'f')) - uu = (unsigned char)((d - ('a'-10)) << 4); - else - return (char *) 0; - d = *(c++); - if ((d >= '0') && (d <= '9')) - uu |= (unsigned char)(d - '0'); - else if ((d >= 'a') && (d <= 'f')) - uu |= (unsigned char)(d - ('a'-10)); - else - return (char *) 0; - *u = uu; - } - return c; -} - -/* - Pack 'void *' into a string buffer. -*/ -SWIGRUNTIME char * -SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { - char *r = buff; - if ((2*sizeof(void *) + 2) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,&ptr,sizeof(void *)); - if (strlen(name) + 1 > (bsz - (r - buff))) return 0; - strcpy(r,name); - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - *ptr = (void *) 0; - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sizeof(void *)); -} - -SWIGRUNTIME char * -SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { - char *r = buff; - size_t lname = (name ? strlen(name) : 0); - if ((2*sz + 2 + lname) > bsz) return 0; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - if (lname) { - strncpy(r,name,lname+1); - } else { - *r = 0; - } - return buff; -} - -SWIGRUNTIME const char * -SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { - if (*c != '_') { - if (strcmp(c,"NULL") == 0) { - memset(ptr,0,sz); - return name; - } else { - return 0; - } - } - return SWIG_UnpackData(++c,ptr,sz); -} - -#ifdef __cplusplus -} -#endif - -/* Errors in SWIG */ -#define SWIG_UnknownError -1 -#define SWIG_IOError -2 -#define SWIG_RuntimeError -3 -#define SWIG_IndexError -4 -#define SWIG_TypeError -5 -#define SWIG_DivisionByZero -6 -#define SWIG_OverflowError -7 -#define SWIG_SyntaxError -8 -#define SWIG_ValueError -9 -#define SWIG_SystemError -10 -#define SWIG_AttributeError -11 -#define SWIG_MemoryError -12 -#define SWIG_NullReferenceError -13 - - - -#ifdef __cplusplus -/* Needed on some windows machines---since MS plays funny games with the header files under C++ */ -#include -#include -extern "C" { -#endif -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */ - -/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */ -#ifndef PERL_REVISION -# if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) -# define PERL_PATCHLEVEL_H_IMPLICIT -# include -# endif -# if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) -# include -# endif -# ifndef PERL_REVISION -# define PERL_REVISION (5) -# define PERL_VERSION PATCHLEVEL -# define PERL_SUBVERSION SUBVERSION -# endif -#endif - -#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) -#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) -#endif - -#ifndef SvIOK_UV -# define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv))) -#endif - -#ifndef SvUOK -# define SvUOK(sv) SvIOK_UV(sv) -#endif - -#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))) -# define PL_sv_undef sv_undef -# define PL_na na -# define PL_errgv errgv -# define PL_sv_no sv_no -# define PL_sv_yes sv_yes -# define PL_markstack_ptr markstack_ptr -#endif - -#ifndef IVSIZE -# ifdef LONGSIZE -# define IVSIZE LONGSIZE -# else -# define IVSIZE 4 /* A bold guess, but the best we can make. */ -# endif -#endif - -#ifndef INT2PTR -# if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) -# define PTRV UV -# define INT2PTR(any,d) (any)(d) -# else -# if PTRSIZE == LONGSIZE -# define PTRV unsigned long -# else -# define PTRV unsigned -# endif -# define INT2PTR(any,d) (any)(PTRV)(d) -# endif - -# define NUM2PTR(any,d) (any)(PTRV)(d) -# define PTR2IV(p) INT2PTR(IV,p) -# define PTR2UV(p) INT2PTR(UV,p) -# define PTR2NV(p) NUM2PTR(NV,p) - -# if PTRSIZE == LONGSIZE -# define PTR2ul(p) (unsigned long)(p) -# else -# define PTR2ul(p) INT2PTR(unsigned long,p) -# endif -#endif /* !INT2PTR */ - -#ifndef SvPV_nolen -# define SvPV_nolen(x) SvPV(x,PL_na) -#endif - -#ifndef get_sv -# define get_sv perl_get_sv -#endif - -#ifndef ERRSV -# define ERRSV get_sv("@",FALSE) -#endif - -#ifndef pTHX_ -#define pTHX_ -#endif - -#include -#ifdef __cplusplus -} -#endif - -/* ----------------------------------------------------------------------------- - * error manipulation - * ----------------------------------------------------------------------------- */ - -SWIGINTERN const char* -SWIG_Perl_ErrorType(int code) { - switch(code) { - case SWIG_MemoryError: - return "MemoryError"; - case SWIG_IOError: - return "IOError"; - case SWIG_RuntimeError: - return "RuntimeError"; - case SWIG_IndexError: - return "IndexError"; - case SWIG_TypeError: - return "TypeError"; - case SWIG_DivisionByZero: - return "ZeroDivisionError"; - case SWIG_OverflowError: - return "OverflowError"; - case SWIG_SyntaxError: - return "SyntaxError"; - case SWIG_ValueError: - return "ValueError"; - case SWIG_SystemError: - return "SystemError"; - case SWIG_AttributeError: - return "AttributeError"; - default: - return "RuntimeError"; - } -} - - -/* ----------------------------------------------------------------------------- - * perlrun.swg - * - * This file contains the runtime support for Perl modules - * and includes code for managing global variables and pointer - * type checking. - * ----------------------------------------------------------------------------- */ - -#ifdef PERL_OBJECT -#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl), -#define SWIG_PERL_OBJECT_CALL pPerl, -#else -#define SWIG_PERL_OBJECT_DECL -#define SWIG_PERL_OBJECT_CALL -#endif - -/* Common SWIG API */ - -/* for raw pointers */ -#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags) -#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own) -#define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags) -#define swig_owntype int - -/* for raw packed data */ -#define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type) -#define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type) - -/* for class or struct pointers */ -#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) -#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) - -/* for C or C++ function pointers */ -#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0) -#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0) - -/* for C++ member pointers, ie, member methods */ -#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty) -#define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type) - - -/* Runtime API */ - -#define SWIG_GetModule(clientdata) SWIG_Perl_GetModule(clientdata) -#define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer) - - -/* Error manipulation */ - -#define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code) -#define SWIG_Error(code, msg) sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg) -#define SWIG_fail goto fail - -/* Perl-specific SWIG API */ - -#define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags) -#define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type) -#define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str) - - -#define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1) -#define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1) -#define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2) -#define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2) - -/* ----------------------------------------------------------------------------- - * pointers/data manipulation - * ----------------------------------------------------------------------------- */ - -/* For backward compatibility only */ -#define SWIG_POINTER_EXCEPTION 0 - -#ifdef __cplusplus -extern "C" { -#endif - -#define SWIG_OWNER SWIG_POINTER_OWN -#define SWIG_SHADOW SWIG_OWNER << 1 - -#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL - -/* SWIG Perl macros */ - -/* Macro to declare an XS function */ -#ifndef XSPROTO -# define XSPROTO(name) void name(pTHX_ CV* cv) -#endif - -/* Macro to call an XS function */ -#ifdef PERL_OBJECT -# define SWIG_CALLXS(_name) _name(cv,pPerl) -#else -# ifndef MULTIPLICITY -# define SWIG_CALLXS(_name) _name(cv) -# else -# define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) -# endif -#endif - -#ifdef PERL_OBJECT -#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) -#define SWIGCLASS_STATIC - -#else /* PERL_OBJECT */ - -#define MAGIC_PPERL -#define SWIGCLASS_STATIC static SWIGUNUSED - -#ifndef MULTIPLICITY -#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#else /* MULTIPLICITY */ - -#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) - -#ifdef __cplusplus -extern "C" { -#endif -typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); -#ifdef __cplusplus -} -#endif - -#endif /* MULTIPLICITY */ -#endif /* PERL_OBJECT */ - -# ifdef PERL_OBJECT -# define SWIG_croak_null() SWIG_Perl_croak_null(pPerl) -static void SWIGUNUSED SWIG_Perl_croak_null(CPerlObj *pPerl) -# else -static void SWIGUNUSED SWIG_croak_null() -# endif -{ - SV *err = get_sv("@", GV_ADD); -# if (PERL_VERSION < 6) - croak("%_", err); -# else - if (sv_isobject(err)) - croak(0); - else - croak("%s", SvPV_nolen(err)); -# endif -} - - -/* - Define how strict is the cast between strings and integers/doubles - when overloading between these types occurs. - - The default is making it as strict as possible by using SWIG_AddCast - when needed. - - You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to - disable the SWIG_AddCast, making the casting between string and - numbers less strict. - - In the end, we try to solve the overloading between strings and - numerical types in the more natural way, but if you can avoid it, - well, avoid it using %rename, for example. -*/ -#ifndef SWIG_PERL_NO_STRICT_STR2NUM -# ifndef SWIG_PERL_STRICT_STR2NUM -# define SWIG_PERL_STRICT_STR2NUM -# endif -#endif -#ifdef SWIG_PERL_STRICT_STR2NUM -/* string takes precedence */ -#define SWIG_Str2NumCast(x) SWIG_AddCast(x) -#else -/* number takes precedence */ -#define SWIG_Str2NumCast(x) x -#endif - - - -#include - -SWIGRUNTIME const char * -SWIG_Perl_TypeProxyName(const swig_type_info *type) { - if (!type) return NULL; - if (type->clientdata != NULL) { - return (const char*) type->clientdata; - } - else { - return type->name; - } -} - -/* Identical to SWIG_TypeCheck, except for strcmp comparison */ -SWIGRUNTIME swig_cast_info * -SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) { - if (ty) { - swig_cast_info *iter = ty->cast; - while (iter) { - if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) { - if (iter == ty->cast) - return iter; - /* Move iter to the top of the linked list */ - iter->prev->next = iter->next; - if (iter->next) - iter->next->prev = iter->prev; - iter->next = ty->cast; - iter->prev = 0; - if (ty->cast) ty->cast->prev = iter; - ty->cast = iter; - return iter; - } - iter = iter->next; - } - } - return 0; -} - -/* Function for getting a pointer value */ - -SWIGRUNTIME int -SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) { - swig_cast_info *tc; - void *voidptr = (void *)0; - SV *tsv = 0; - - if (own) - *own = 0; - - /* If magical, apply more magic */ - if (SvGMAGICAL(sv)) - mg_get(sv); - - /* Check to see if this is an object */ - if (sv_isobject(sv)) { - IV tmp = 0; - tsv = (SV*) SvRV(sv); - if ((SvTYPE(tsv) == SVt_PVHV)) { - MAGIC *mg; - if (SvMAGICAL(tsv)) { - mg = mg_find(tsv,'P'); - if (mg) { - sv = mg->mg_obj; - if (sv_isobject(sv)) { - tsv = (SV*)SvRV(sv); - tmp = SvIV(tsv); - } - } - } else { - return SWIG_ERROR; - } - } else { - tmp = SvIV(tsv); - } - voidptr = INT2PTR(void *,tmp); - } else if (! SvOK(sv)) { /* Check for undef */ - *(ptr) = (void *) 0; - return SWIG_OK; - } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ - if (!SvROK(sv)) { - /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ - if (SvIOK(sv)) { - return SWIG_ERROR; - } else { - /* NULL pointer (reference to undef). */ - *(ptr) = (void *) 0; - return SWIG_OK; - } - } else { - return SWIG_ERROR; - } - } else { /* Don't know what it is */ - return SWIG_ERROR; - } - if (_t) { - /* Now see if the types match */ - char *_c = HvNAME(SvSTASH(SvRV(sv))); - tc = SWIG_TypeProxyCheck(_c,_t); -#ifdef SWIG_DIRECTORS - if (!tc && !sv_derived_from(sv,SWIG_Perl_TypeProxyName(_t))) { -#else - if (!tc) { -#endif - return SWIG_ERROR; - } - { - int newmemory = 0; - *ptr = SWIG_TypeCast(tc,voidptr,&newmemory); - if (newmemory == SWIG_CAST_NEW_MEMORY) { - assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ - if (own) - *own = *own | SWIG_CAST_NEW_MEMORY; - } - } - } else { - *ptr = voidptr; - } - - /* - * DISOWN implementation: we need a perl guru to check this one. - */ - if (tsv && (flags & SWIG_POINTER_DISOWN)) { - /* - * almost copy paste code from below SWIG_POINTER_OWN setting - */ - SV *obj = sv; - HV *stash = SvSTASH(SvRV(obj)); - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - if (isGV(gv)) { - HV *hv = GvHVn(gv); - /* - * To set ownership (see below), a newSViv(1) entry is added. - * Hence, to remove ownership, we delete the entry. - */ - if (hv_exists_ent(hv, obj, 0)) { - hv_delete_ent(hv, obj, 0, 0); - } - } - } - return SWIG_OK; -} - -SWIGRUNTIME int -SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) { - return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0); -} - -SWIGRUNTIME void -SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) { - if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) { - SV *self; - SV *obj=newSV(0); - HV *hash=newHV(); - HV *stash; - sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr); - stash=SvSTASH(SvRV(obj)); - if (flags & SWIG_POINTER_OWN) { - HV *hv; - GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE); - if (!isGV(gv)) - gv_init(gv, stash, "OWNER", 5, FALSE); - hv=GvHVn(gv); - hv_store_ent(hv, obj, newSViv(1), 0); - } - sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0); - SvREFCNT_dec(obj); - self=newRV_noinc((SV *)hash); - sv_setsv(sv, self); - SvREFCNT_dec((SV *)self); - sv_bless(sv, stash); - } - else { - sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr); - } -} - -SWIGRUNTIMEINLINE SV * -SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) { - SV *result = sv_newmortal(); - SWIG_MakePtr(result, ptr, t, flags); - return result; -} - -SWIGRUNTIME void -SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) { - char result[1024]; - char *r = result; - if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return; - *(r++) = '_'; - r = SWIG_PackData(r,ptr,sz); - strcpy(r,SWIG_Perl_TypeProxyName(type)); - sv_setpv(sv, result); -} - -SWIGRUNTIME SV * -SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) { - SV *result = sv_newmortal(); - SWIG_Perl_MakePackedObj(result, ptr, sz, type); - return result; -} - -/* Convert a packed value value */ -SWIGRUNTIME int -SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) { - swig_cast_info *tc; - const char *c = 0; - - if ((!obj) || (!SvOK(obj))) return SWIG_ERROR; - c = SvPV_nolen(obj); - /* Pointer values must start with leading underscore */ - if (*c != '_') return SWIG_ERROR; - c++; - c = SWIG_UnpackData(c,ptr,sz); - if (ty) { - tc = SWIG_TypeCheck(c,ty); - if (!tc) return SWIG_ERROR; - } - return SWIG_OK; -} - - -/* Macros for low-level exception handling */ -#define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; } - - -typedef XSPROTO(SwigPerlWrapper); -typedef SwigPerlWrapper *SwigPerlWrapperPtr; - -/* Structure for command table */ -typedef struct { - const char *name; - SwigPerlWrapperPtr wrapper; -} swig_command_info; - -/* Information for constant table */ - -#define SWIG_INT 1 -#define SWIG_FLOAT 2 -#define SWIG_STRING 3 -#define SWIG_POINTER 4 -#define SWIG_BINARY 5 - -/* Constant information structure */ -typedef struct swig_constant_info { - int type; - const char *name; - long lvalue; - double dvalue; - void *pvalue; - swig_type_info **ptype; -} swig_constant_info; - - -/* Structure for variable table */ -typedef struct { - const char *name; - SwigMagicFunc set; - SwigMagicFunc get; - swig_type_info **type; -} swig_variable_info; - -/* Magic variable code */ -#ifndef PERL_OBJECT -# ifdef __cplusplus -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast(a),b,c) -# else -# define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c) -# endif -# ifndef MULTIPLICITY -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) -# else -SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) -# endif -#else -# define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) -SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) -#endif -{ - MAGIC *mg; - sv_magic(sv,sv,'U',name,strlen(name)); - mg = mg_find(sv,'U'); - mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); - mg->mg_virtual->svt_get = (SwigMagicFunc) get; - mg->mg_virtual->svt_set = (SwigMagicFunc) set; - mg->mg_virtual->svt_len = 0; - mg->mg_virtual->svt_clear = 0; - mg->mg_virtual->svt_free = 0; -} - - -SWIGRUNTIME swig_module_info * -SWIG_Perl_GetModule(void *SWIGUNUSEDPARM(clientdata)) { - static void *type_pointer = (void *)0; - SV *pointer; - - /* first check if pointer already created */ - if (!type_pointer) { - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI); - if (pointer && SvOK(pointer)) { - type_pointer = INT2PTR(swig_type_info **, SvIV(pointer)); - } - } - - return (swig_module_info *) type_pointer; -} - -SWIGRUNTIME void -SWIG_Perl_SetModule(swig_module_info *module) { - SV *pointer; - - /* create a new pointer */ - pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI); - sv_setiv(pointer, PTR2IV(module)); -} - -#ifdef __cplusplus -} -#endif - -/* Workaround perl5 global namespace pollution. Note that undefining library - * functions like fopen will not solve the problem on all platforms as fopen - * might be a macro on Windows but not necessarily on other operating systems. */ -#ifdef do_open - #undef do_open -#endif -#ifdef do_close - #undef do_close -#endif -#ifdef do_exec - #undef do_exec -#endif -#ifdef scalar - #undef scalar -#endif -#ifdef list - #undef list -#endif -#ifdef apply - #undef apply -#endif -#ifdef convert - #undef convert -#endif -#ifdef Error - #undef Error -#endif -#ifdef form - #undef form -#endif -#ifdef vform - #undef vform -#endif -#ifdef LABEL - #undef LABEL -#endif -#ifdef METHOD - #undef METHOD -#endif -#ifdef Move - #undef Move -#endif -#ifdef yylex - #undef yylex -#endif -#ifdef yyparse - #undef yyparse -#endif -#ifdef yyerror - #undef yyerror -#endif -#ifdef invert - #undef invert -#endif -#ifdef ref - #undef ref -#endif -#ifdef read - #undef read -#endif -#ifdef write - #undef write -#endif -#ifdef eof - #undef eof -#endif -#ifdef close - #undef close -#endif -#ifdef rewind - #undef rewind -#endif -#ifdef free - #undef free -#endif -#ifdef malloc - #undef malloc -#endif -#ifdef calloc - #undef calloc -#endif -#ifdef Stat - #undef Stat -#endif -#ifdef check - #undef check -#endif -#ifdef seekdir - #undef seekdir -#endif -#ifdef open - #undef open -#endif -#ifdef readdir - #undef readdir -#endif -#ifdef bind - #undef bind -#endif -#ifdef access - #undef access -#endif -#ifdef stat - #undef stat -#endif -#ifdef seed - #undef seed -#endif - -#ifdef bool - /* Leave if macro is from C99 stdbool.h */ - #ifndef __bool_true_false_are_defined - #undef bool - #endif -#endif - - - - -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) - -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else - - - -/* -------- TYPES TABLE (BEGIN) -------- */ - -#define SWIGTYPE_p_ConstituentDisplayStyle swig_types[0] -#define SWIGTYPE_p_Cost_Model_type swig_types[1] -#define SWIGTYPE_p_Dictionary_s swig_types[2] -#define SWIGTYPE_p_Linkage_s swig_types[3] -#define SWIGTYPE_p_Parse_Options_s swig_types[4] -#define SWIGTYPE_p_Sentence_s swig_types[5] -#define SWIGTYPE_p_char swig_types[6] -#define SWIGTYPE_p_lg_errinfo swig_types[7] -#define SWIGTYPE_p_lg_error_severity swig_types[8] -#define SWIGTYPE_p_p_char swig_types[9] -#define SWIGTYPE_p_size_t swig_types[10] -static swig_type_info *swig_types[12]; -static swig_module_info swig_module = {swig_types, 11, 0, 0, 0, 0}; -#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) -#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) - -/* -------- TYPES TABLE (END) -------- */ - -#define SWIG_init boot_clinkgrammar - -#define SWIG_name "clinkgrammarc::boot_clinkgrammar" -#define SWIG_prefix "clinkgrammarc::" - -#define SWIGVERSION 0x030010 -#define SWIG_VERSION SWIGVERSION - - -#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) -#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) - - -#include - - -#ifdef __cplusplus -extern "C" -#endif -#ifndef PERL_OBJECT -#ifndef MULTIPLICITY -SWIGEXPORT void SWIG_init (CV* cv); -#else -SWIGEXPORT void SWIG_init (pTHXo_ CV* cv); -#endif -#else -SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); -#endif - - - -#include - - - -SWIGINTERNINLINE SV * -SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) -{ - SV *sv; - if (IVSIZE >= sizeof(value) || (value >= IV_MIN && value <= IV_MAX)) - sv = newSViv(value); - else - sv = newSVpvf("%ld", value); - return sv_2mortal(sv); -} - - -SWIGINTERNINLINE SV * -SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) -{ - return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); -} - - -SWIGINTERNINLINE SV * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SV *obj = sv_newmortal(); - if (carray) { - sv_setpvn(obj, carray, size); - } else { - sv_setsv(obj, &PL_sv_undef); - } - return obj; -} - - -SWIGINTERNINLINE SV * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERN swig_type_info* -SWIG_pchar_descriptor(void) -{ - static int init = 0; - static swig_type_info* info = 0; - if (!init) { - info = SWIG_TypeQuery("_p_char"); - init = 1; - } - return info; -} - - -SWIGINTERN int -SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -{ - if (SvMAGICAL(obj)) { - SV *tmp = sv_newmortal(); - SvSetSV(tmp, obj); - obj = tmp; - } - if (SvPOK(obj)) { - STRLEN len = 0; - char *cstr = SvPV(obj, len); - size_t size = len + 1; - if (cptr) { - if (alloc) { - if (*alloc == SWIG_NEWOBJ) { - *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size))); - } else { - *cptr = cstr; - *alloc = SWIG_OLDOBJ; - } - } - } - if (psize) *psize = size; - return SWIG_OK; - } else { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - if (pchar_descriptor) { - char* vptr = 0; - if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) { - if (cptr) *cptr = vptr; - if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0; - if (alloc) *alloc = SWIG_OLDOBJ; - return SWIG_OK; - } - } - } - return SWIG_TypeError; -} - - - - - -#include -#if !defined(SWIG_NO_LLONG_MAX) -# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) -# define LLONG_MAX __LONG_LONG_MAX__ -# define LLONG_MIN (-LLONG_MAX - 1LL) -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) -# endif -#endif - - -#include -#ifdef _MSC_VER -# ifndef strtoull -# define strtoull _strtoui64 -# endif -# ifndef strtoll -# define strtoll _strtoi64 -# endif -#endif - - -SWIGINTERN int -SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val) -{ - if (SvNIOK(obj)) { - if (val) *val = SvNV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - if (val) *val = (double) SvIV(obj); - return SWIG_AddCast(SWIG_OK); - } else { - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - double v; - errno = 0; - v = strtod(nptr, &endptr); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - } - return SWIG_TypeError; -} - - -#include - - -#include - - -SWIGINTERNINLINE int -SWIG_CanCastAsInteger(double *d, double min, double max) { - double x = *d; - if ((min <= x && x <= max)) { - double fx = floor(x); - double cx = ceil(x); - double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ - if ((errno == EDOM) || (errno == ERANGE)) { - errno = 0; - } else { - double summ, reps, diff; - if (rd < x) { - diff = x - rd; - } else if (rd > x) { - diff = rd - x; - } else { - return 1; - } - summ = rd + x; - reps = diff/summ; - if (reps < 8*DBL_EPSILON) { - *d = rd; - return 1; - } - } - } - return 0; -} - - -SWIGINTERN int -SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE < sizeof(*val) || v <= LONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (IVSIZE <= sizeof(*val) || (v >= LONG_MIN && v <= LONG_MAX)) { - if(val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - long v; - errno = 0; - v = strtol(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { - if (val) *val = (long)(d); - return res; - } - } - } - return SWIG_TypeError; -} - - -SWIGINTERN int -SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) -{ - long v; - int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v); - if (SWIG_IsOK(res)) { - if ((v < INT_MIN || v > INT_MAX)) { - return SWIG_OverflowError; - } else { - if (val) *val = static_cast< int >(v); - } - } - return res; -} - - -SWIGINTERNINLINE SV * -SWIG_From_double SWIG_PERL_DECL_ARGS_1(double value) -{ - return sv_2mortal(newSVnv(value)); -} - - -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) -{ - if (SvUOK(obj)) { - UV v = SvUV(obj); - if (UVSIZE <= sizeof(*val) || v <= ULONG_MAX) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } - return SWIG_OverflowError; - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long v; - errno = 0; - v = strtoul(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - double d; - int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { - if (val) *val = (unsigned long)(d); - return res; - } - } - } - return SWIG_TypeError; -} - - -#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) -# define SWIG_LONG_LONG_AVAILABLE -#endif - - -#ifdef SWIG_LONG_LONG_AVAILABLE -SWIGINTERN int -SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long long *val) -{ - if (SvUOK(obj)) { - /* pretty sure this should be conditional on - * (UVSIZE <= sizeof(*val) || v <= ULLONG_MAX) */ - if (val) *val = SvUV(obj); - return SWIG_OK; - } else if (SvIOK(obj)) { - IV v = SvIV(obj); - if (v >= 0 && (IVSIZE <= sizeof(*val) || v <= ULLONG_MAX)) { - if (val) *val = v; - return SWIG_OK; - } else { - return SWIG_OverflowError; - } - } else { - int dispatch = 0; - const char *nptr = SvPV_nolen(obj); - if (nptr) { - char *endptr; - unsigned long long v; - errno = 0; - v = strtoull(nptr, &endptr,0); - if (errno == ERANGE) { - errno = 0; - return SWIG_OverflowError; - } else { - if (*endptr == '\0') { - if (val) *val = v; - return SWIG_Str2NumCast(SWIG_OK); - } - } - } - if (!dispatch) { - const double mant_max = 1LL << DBL_MANT_DIG; - double d; - int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d)); - if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { - if (val) *val = (unsigned long long)(d); - return res; - } - } - } - return SWIG_TypeError; -} -#endif - - -SWIGINTERNINLINE int -SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val) -{ - int res = SWIG_TypeError; -#ifdef SWIG_LONG_LONG_AVAILABLE - if (sizeof(size_t) <= sizeof(unsigned long)) { -#endif - unsigned long v; - res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); -#ifdef SWIG_LONG_LONG_AVAILABLE - } else if (sizeof(size_t) <= sizeof(unsigned long long)) { - unsigned long long v; - res = SWIG_AsVal_unsigned_SS_long_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0); - if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); - } -#endif - return res; -} - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef PERL_OBJECT -#define MAGIC_CLASS _wrap_clinkgrammar_var:: -class _wrap_clinkgrammar_var : public CPerlObj { -public: -#else -#define MAGIC_CLASS -#endif -SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) { - MAGIC_PPERL - croak("Value is read-only."); - return 0; -} - - -#ifdef PERL_OBJECT -}; -#endif - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -extern "C" { -#endif -XS(_wrap_lg_errinfo_severity_get) { - { - lg_errinfo *arg1 = (lg_errinfo *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - lg_error_severity result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: lg_errinfo_severity_get(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_lg_errinfo, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lg_errinfo_severity_get" "', argument " "1"" of type '" "lg_errinfo *""'"); - } - arg1 = reinterpret_cast< lg_errinfo * >(argp1); - result = (lg_error_severity) ((arg1)->severity); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_lg_errinfo_severity_label_get) { - { - lg_errinfo *arg1 = (lg_errinfo *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: lg_errinfo_severity_label_get(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_lg_errinfo, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lg_errinfo_severity_label_get" "', argument " "1"" of type '" "lg_errinfo *""'"); - } - arg1 = reinterpret_cast< lg_errinfo * >(argp1); - result = (char *) ((arg1)->severity_label); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_lg_errinfo_text_get) { - { - lg_errinfo *arg1 = (lg_errinfo *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: lg_errinfo_text_get(self);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_lg_errinfo, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lg_errinfo_text_get" "', argument " "1"" of type '" "lg_errinfo *""'"); - } - arg1 = reinterpret_cast< lg_errinfo * >(argp1); - result = (char *) ((arg1)->text); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_new_lg_errinfo) { - { - int argvi = 0; - lg_errinfo *result = 0 ; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: new_lg_errinfo();"); - } - result = (lg_errinfo *)new lg_errinfo(); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_lg_errinfo, SWIG_OWNER | SWIG_SHADOW); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_linkgrammar_get_version) { - { - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: linkgrammar_get_version();"); - } - result = (char *)linkgrammar_get_version(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_linkgrammar_get_configuration) { - { - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: linkgrammar_get_configuration();"); - } - result = (char *)linkgrammar_get_configuration(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_linkgrammar_get_dict_version) { - { - Dictionary arg1 = (Dictionary) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkgrammar_get_dict_version(dict);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Dictionary_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkgrammar_get_dict_version" "', argument " "1"" of type '" "Dictionary""'"); - } - arg1 = reinterpret_cast< Dictionary >(argp1); - result = (char *)linkgrammar_get_dict_version(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkgrammar_get_dict_locale) { - { - Dictionary arg1 = (Dictionary) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkgrammar_get_dict_locale(dict);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Dictionary_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkgrammar_get_dict_locale" "', argument " "1"" of type '" "Dictionary""'"); - } - arg1 = reinterpret_cast< Dictionary >(argp1); - result = (char *)linkgrammar_get_dict_locale(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_create_lang) { - { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int argvi = 0; - Dictionary result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: dictionary_create_lang(lang);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dictionary_create_lang" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - result = (Dictionary)dictionary_create_lang((char const *)arg1); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dictionary_s, 0 | 0); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_create_default_lang) { - { - int argvi = 0; - Dictionary result; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: dictionary_create_default_lang();"); - } - result = (Dictionary)dictionary_create_default_lang(); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Dictionary_s, 0 | 0); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_get_lang) { - { - Dictionary arg1 = (Dictionary) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: dictionary_get_lang(dict);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Dictionary_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dictionary_get_lang" "', argument " "1"" of type '" "Dictionary""'"); - } - arg1 = reinterpret_cast< Dictionary >(argp1); - result = (char *)dictionary_get_lang(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_delete) { - { - Dictionary arg1 = (Dictionary) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: dictionary_delete(dict);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Dictionary_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dictionary_delete" "', argument " "1"" of type '" "Dictionary""'"); - } - arg1 = reinterpret_cast< Dictionary >(argp1); - dictionary_delete(arg1); - ST(argvi) = sv_newmortal(); - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_set_data_dir) { - { - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: dictionary_set_data_dir(path);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dictionary_set_data_dir" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - dictionary_set_data_dir((char const *)arg1); - ST(argvi) = sv_newmortal(); - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - SWIG_croak_null(); - } -} - - -XS(_wrap_dictionary_get_data_dir) { - { - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: dictionary_get_data_dir();"); - } - result = (char *)dictionary_get_data_dir(); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - delete[] result; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_create) { - { - int argvi = 0; - Parse_Options result; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: parse_options_create();"); - } - result = (Parse_Options)parse_options_create(); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Parse_Options_s, 0 | 0); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_delete) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_delete(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_delete" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_delete(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_verbosity) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_verbosity(opts,verbosity);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_verbosity" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_verbosity" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_verbosity(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_verbosity) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_verbosity(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_verbosity" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_verbosity(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_linkage_limit) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_linkage_limit(opts,linkage_limit);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_linkage_limit" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_linkage_limit" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_linkage_limit(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_linkage_limit) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_linkage_limit(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_linkage_limit" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_linkage_limit(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_disjunct_cost) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - double arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - double val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_disjunct_cost(opts,disjunct_cost);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_disjunct_cost" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_disjunct_cost" "', argument " "2"" of type '" "double""'"); - } - arg2 = static_cast< double >(val2); - parse_options_set_disjunct_cost(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_disjunct_cost) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - double result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_disjunct_cost(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_disjunct_cost" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (double)parse_options_get_disjunct_cost(arg1); - ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_min_null_count) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_min_null_count(opts,null_count);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_min_null_count" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_min_null_count" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_min_null_count(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_min_null_count) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_min_null_count(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_min_null_count" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_min_null_count(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_max_null_count) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_max_null_count(opts,null_count);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_max_null_count" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_max_null_count" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_max_null_count(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_max_null_count) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_max_null_count(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_max_null_count" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_max_null_count(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_islands_ok) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_islands_ok(opts,islands_ok);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_islands_ok" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_islands_ok" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_islands_ok(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_islands_ok) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_islands_ok(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_islands_ok" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_islands_ok(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_short_length) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_short_length(opts,short_length);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_short_length" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_short_length" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_short_length(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_short_length) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_short_length(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_short_length" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_short_length(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_max_memory) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_max_memory(opts,mem);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_max_memory" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_max_memory" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_max_memory(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_max_memory) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_max_memory(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_max_memory" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_max_memory(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_max_parse_time) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_max_parse_time(opts,secs);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_max_parse_time" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_max_parse_time" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_max_parse_time(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_max_parse_time) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_max_parse_time(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_max_parse_time" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_max_parse_time(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_cost_model_type) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - Cost_Model_type arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_cost_model_type(opts,cm);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_cost_model_type" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_cost_model_type" "', argument " "2"" of type '" "Cost_Model_type""'"); - } - arg2 = static_cast< Cost_Model_type >(val2); - parse_options_set_cost_model_type(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_cost_model_type) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - Cost_Model_type result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_cost_model_type(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_cost_model_type" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (Cost_Model_type)parse_options_get_cost_model_type(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_timer_expired) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_timer_expired(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_timer_expired" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_timer_expired(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_memory_exhausted) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_memory_exhausted(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_memory_exhausted" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_memory_exhausted(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_resources_exhausted) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_resources_exhausted(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_resources_exhausted" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_resources_exhausted(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_display_morphology) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_display_morphology(opts,val);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_display_morphology" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_display_morphology" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_display_morphology(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_display_morphology) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_display_morphology(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_display_morphology" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_display_morphology(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_spell_guess) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_spell_guess(opts,val);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_spell_guess" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_spell_guess" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_spell_guess(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_spell_guess) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_spell_guess(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_spell_guess" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_spell_guess(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_all_short_connectors) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_all_short_connectors(opts,val);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_all_short_connectors" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_all_short_connectors" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_all_short_connectors(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_all_short_connectors) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_all_short_connectors(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_all_short_connectors" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_all_short_connectors(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_reset_resources) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_reset_resources(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_reset_resources" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - parse_options_reset_resources(arg1); - ST(argvi) = sv_newmortal(); - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_set_use_sat_parser) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: parse_options_set_use_sat_parser(opts,val);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_set_use_sat_parser" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "parse_options_set_use_sat_parser" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - parse_options_set_use_sat_parser(arg1,arg2); - ST(argvi) = sv_newmortal(); - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_parse_options_get_use_sat_parser) { - { - Parse_Options arg1 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: parse_options_get_use_sat_parser(opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_options_get_use_sat_parser" "', argument " "1"" of type '" "Parse_Options""'"); - } - arg1 = reinterpret_cast< Parse_Options >(argp1); - result = (int)parse_options_get_use_sat_parser(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_create) { - { - char *arg1 = (char *) 0 ; - Dictionary arg2 = (Dictionary) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int argvi = 0; - Sentence result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_create(input_string,dict);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_create" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_Dictionary_s, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sentence_create" "', argument " "2"" of type '" "Dictionary""'"); - } - arg2 = reinterpret_cast< Dictionary >(argp2); - result = (Sentence)sentence_create((char const *)arg1,arg2); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Sentence_s, 0 | 0); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_delete) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_delete(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_delete" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - sentence_delete(arg1); - ST(argvi) = sv_newmortal(); - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_split) { - { - Sentence arg1 = (Sentence) 0 ; - Parse_Options arg2 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_split(sent,opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_split" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sentence_split" "', argument " "2"" of type '" "Parse_Options""'"); - } - arg2 = reinterpret_cast< Parse_Options >(argp2); - result = (int)sentence_split(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_parse) { - { - Sentence arg1 = (Sentence) 0 ; - Parse_Options arg2 = (Parse_Options) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_parse(sent,opts);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_parse" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sentence_parse" "', argument " "2"" of type '" "Parse_Options""'"); - } - arg2 = reinterpret_cast< Parse_Options >(argp2); - result = (int)sentence_parse(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_length) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_length(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_length" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - result = (int)sentence_length(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_null_count) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_null_count(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_null_count" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - result = (int)sentence_null_count(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_num_linkages_found) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_num_linkages_found(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_num_linkages_found" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - result = (int)sentence_num_linkages_found(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_num_valid_linkages) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_num_valid_linkages(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_num_valid_linkages" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - result = (int)sentence_num_valid_linkages(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_num_linkages_post_processed) { - { - Sentence arg1 = (Sentence) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: sentence_num_linkages_post_processed(sent);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_num_linkages_post_processed" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - result = (int)sentence_num_linkages_post_processed(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_num_violations) { - { - Sentence arg1 = (Sentence) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_num_violations(sent,i);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_num_violations" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sentence_num_violations" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)sentence_num_violations(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_disjunct_cost) { - { - Sentence arg1 = (Sentence) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - double result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_disjunct_cost(sent,i);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_disjunct_cost" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sentence_disjunct_cost" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (double)sentence_disjunct_cost(arg1,arg2); - ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_sentence_link_cost) { - { - Sentence arg1 = (Sentence) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: sentence_link_cost(sent,i);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sentence_link_cost" "', argument " "1"" of type '" "Sentence""'"); - } - arg1 = reinterpret_cast< Sentence >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sentence_link_cost" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)sentence_link_cost(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_create) { - { - int arg1 ; - Sentence arg2 = (Sentence) 0 ; - Parse_Options arg3 = (Parse_Options) 0 ; - int val1 ; - int ecode1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - int argvi = 0; - Linkage result; - dXSARGS; - - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: linkage_create(index,sent,opts);"); - } - ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1); - if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "linkage_create" "', argument " "1"" of type '" "int""'"); - } - arg1 = static_cast< int >(val1); - res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_Sentence_s, 0 | 0 ); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "linkage_create" "', argument " "2"" of type '" "Sentence""'"); - } - arg2 = reinterpret_cast< Sentence >(argp2); - res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Parse_Options_s, 0 | 0 ); - if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "linkage_create" "', argument " "3"" of type '" "Parse_Options""'"); - } - arg3 = reinterpret_cast< Parse_Options >(argp3); - result = (Linkage)linkage_create(arg1,arg2,arg3); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Linkage_s, 0 | 0); argvi++ ; - - - - XSRETURN(argvi); - fail: - - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_delete) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_delete(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_delete" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - linkage_delete(arg1); - ST(argvi) = sv_newmortal(); - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_diagram) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - size_t arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - size_t val3 ; - int ecode3 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: linkage_print_diagram(linkage,display_walls,screen_width);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_diagram" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_print_diagram" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "linkage_print_diagram" "', argument " "3"" of type '" "size_t""'"); - } - arg3 = static_cast< size_t >(val3); - result = (char *)linkage_print_diagram(arg1,arg2,arg3); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - - { - linkage_free_diagram(result); - } - XSRETURN(argvi); - fail: - - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_postscript) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - int arg3 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int val3 ; - int ecode3 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 3) || (items > 3)) { - SWIG_croak("Usage: linkage_print_postscript(linkage,display_walls,print_ps_header);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_postscript" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_print_postscript" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "linkage_print_postscript" "', argument " "3"" of type '" "int""'"); - } - arg3 = static_cast< int >(val3); - result = (char *)linkage_print_postscript(arg1,arg2,arg3); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - - { - linkage_free_postscript(result); - } - XSRETURN(argvi); - fail: - - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_links_and_domains) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_print_links_and_domains(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_links_and_domains" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char *)linkage_print_links_and_domains(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - { - linkage_free_links_and_domains(result); - } - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_senses) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_print_senses(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_senses" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char *)linkage_print_senses(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - { - linkage_free_senses(result); - } - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_constituent_tree) { - { - Linkage arg1 = (Linkage) 0 ; - ConstituentDisplayStyle arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_print_constituent_tree(linkage,mode);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_constituent_tree" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_print_constituent_tree" "', argument " "2"" of type '" "ConstituentDisplayStyle""'"); - } - arg2 = static_cast< ConstituentDisplayStyle >(val2); - result = (char *)linkage_print_constituent_tree(arg1,arg2); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - { - linkage_free_constituent_tree_str(result); - } - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_disjuncts) { - { - Linkage arg1 = (Linkage) (Linkage)0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_print_disjuncts(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_disjuncts" "', argument " "1"" of type '" "Linkage const""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char *)linkage_print_disjuncts(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_print_pp_msgs) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_print_pp_msgs(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_print_pp_msgs" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char *)linkage_print_pp_msgs(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_num_words) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_get_num_words(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_num_words" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (int)linkage_get_num_words(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_num_links) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_get_num_links(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_num_links" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (int)linkage_get_num_links(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_lword) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_lword(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_lword" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_lword" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_link_lword(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_rword) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_rword(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_rword" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_rword" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_link_rword(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_length) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_length(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_length" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_length" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_link_length(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_label) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_label(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_label" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_label" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (char *)linkage_get_link_label(arg1,arg2); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_llabel) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_llabel(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_llabel" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_llabel" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (char *)linkage_get_link_llabel(arg1,arg2); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_rlabel) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_rlabel(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_rlabel" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_rlabel" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (char *)linkage_get_link_rlabel(arg1,arg2); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_num_domains) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_num_domains(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_num_domains" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_num_domains" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_link_num_domains(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_link_domain_names) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char **result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_link_domain_names(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_link_domain_names" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_link_domain_names" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (char **)linkage_get_link_domain_names(arg1,arg2); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_words) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char **result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_get_words(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_words" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char **)linkage_get_words(arg1); - ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_word) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_word(linkage,w);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_word" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_word" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (char *)linkage_get_word(arg1,arg2); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_word_byte_start) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_word_byte_start(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_word_byte_start" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_word_byte_start" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_word_byte_start(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_word_byte_end) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_word_byte_end(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_word_byte_end" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_word_byte_end" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_word_byte_end(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_word_char_start) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_word_char_start(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_word_char_start" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_word_char_start" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_word_char_start(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_word_char_end) { - { - Linkage arg1 = (Linkage) 0 ; - int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: linkage_get_word_char_end(linkage,index);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_word_char_end" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2); - if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "linkage_get_word_char_end" "', argument " "2"" of type '" "int""'"); - } - arg2 = static_cast< int >(val2); - result = (int)linkage_get_word_char_end(arg1,arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - - XSRETURN(argvi); - fail: - - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_unused_word_cost) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_unused_word_cost(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_unused_word_cost" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (int)linkage_unused_word_cost(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_disjunct_cost) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - double result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_disjunct_cost(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_disjunct_cost" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (double)linkage_disjunct_cost(arg1); - ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_link_cost) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_link_cost(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_link_cost" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (int)linkage_link_cost(arg1); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_corpus_cost) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - double result; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_corpus_cost(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_corpus_cost" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (double)linkage_corpus_cost(arg1); - ST(argvi) = SWIG_From_double SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_linkage_get_violation_name) { - { - Linkage arg1 = (Linkage) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: linkage_get_violation_name(linkage);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Linkage_s, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "linkage_get_violation_name" "', argument " "1"" of type '" "Linkage""'"); - } - arg1 = reinterpret_cast< Linkage >(argp1); - result = (char *)linkage_get_violation_name(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap__lg_error_formatmsg) { - { - lg_errinfo *arg1 = (lg_errinfo *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - int argvi = 0; - char *result = 0 ; - dXSARGS; - - if ((items < 1) || (items > 1)) { - SWIG_croak("Usage: _lg_error_formatmsg(lge);"); - } - res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_lg_errinfo, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_lg_error_formatmsg" "', argument " "1"" of type '" "lg_errinfo *""'"); - } - arg1 = reinterpret_cast< lg_errinfo * >(argp1); - result = (char *)lg_error_formatmsg(arg1); - ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; - - { - free(result); - } - XSRETURN(argvi); - fail: - - SWIG_croak_null(); - } -} - - -XS(_wrap_lg_error_clearall) { - { - int argvi = 0; - int result; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: lg_error_clearall();"); - } - result = (int)lg_error_clearall(); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - -XS(_wrap__prt_error) { - { - char *arg1 = (char *) 0 ; - char *arg2 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - int argvi = 0; - int result; - dXSARGS; - - if ((items < 2) || (items > 2)) { - SWIG_croak("Usage: _prt_error(char const *,char const *);"); - } - res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_prt_error" "', argument " "1"" of type '" "char const *""'"); - } - arg1 = reinterpret_cast< char * >(buf1); - res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_prt_error" "', argument " "2"" of type '" "char const *""'"); - } - arg2 = reinterpret_cast< char * >(buf2); - result = (int)prt_error((char const *)arg1,(char const *)arg2); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - XSRETURN(argvi); - fail: - if (alloc1 == SWIG_NEWOBJ) delete[] buf1; - if (alloc2 == SWIG_NEWOBJ) delete[] buf2; - SWIG_croak_null(); - } -} - - -XS(_wrap_lg_error_flush) { - { - int argvi = 0; - int result; - dXSARGS; - - if ((items < 0) || (items > 0)) { - SWIG_croak("Usage: lg_error_flush();"); - } - result = (int)lg_error_flush(); - ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ; - XSRETURN(argvi); - fail: - SWIG_croak_null(); - } -} - - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ - -static swig_type_info _swigt__p_ConstituentDisplayStyle = {"_p_ConstituentDisplayStyle", "enum ConstituentDisplayStyle *|ConstituentDisplayStyle *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Cost_Model_type = {"_p_Cost_Model_type", "enum Cost_Model_type *|Cost_Model_type *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Dictionary_s = {"_p_Dictionary_s", "Dictionary_s *|Dictionary", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Linkage_s = {"_p_Linkage_s", "Linkage_s *|Linkage", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Parse_Options_s = {"_p_Parse_Options_s", "Parse_Options_s *|Parse_Options", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_Sentence_s = {"_p_Sentence_s", "Sentence|Sentence_s *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_lg_errinfo = {"_p_lg_errinfo", "lg_errinfo *", 0, 0, (void*)"clinkgrammar::lg_errinfo", 0}; -static swig_type_info _swigt__p_lg_error_severity = {"_p_lg_error_severity", "enum lg_error_severity *|lg_error_severity *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_size_t = {"_p_size_t", "LinkageIdx *|size_t *|LinkIdx *|WordIdx *", 0, 0, (void*)0, 0}; - -static swig_type_info *swig_type_initial[] = { - &_swigt__p_ConstituentDisplayStyle, - &_swigt__p_Cost_Model_type, - &_swigt__p_Dictionary_s, - &_swigt__p_Linkage_s, - &_swigt__p_Parse_Options_s, - &_swigt__p_Sentence_s, - &_swigt__p_char, - &_swigt__p_lg_errinfo, - &_swigt__p_lg_error_severity, - &_swigt__p_p_char, - &_swigt__p_size_t, -}; - -static swig_cast_info _swigc__p_ConstituentDisplayStyle[] = { {&_swigt__p_ConstituentDisplayStyle, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Cost_Model_type[] = { {&_swigt__p_Cost_Model_type, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Dictionary_s[] = { {&_swigt__p_Dictionary_s, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Linkage_s[] = { {&_swigt__p_Linkage_s, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Parse_Options_s[] = { {&_swigt__p_Parse_Options_s, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_Sentence_s[] = { {&_swigt__p_Sentence_s, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_lg_errinfo[] = { {&_swigt__p_lg_errinfo, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_lg_error_severity[] = { {&_swigt__p_lg_error_severity, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; -static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}}; - -static swig_cast_info *swig_cast_initial[] = { - _swigc__p_ConstituentDisplayStyle, - _swigc__p_Cost_Model_type, - _swigc__p_Dictionary_s, - _swigc__p_Linkage_s, - _swigc__p_Parse_Options_s, - _swigc__p_Sentence_s, - _swigc__p_char, - _swigc__p_lg_errinfo, - _swigc__p_lg_error_severity, - _swigc__p_p_char, - _swigc__p_size_t, -}; - - -/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ - -static swig_constant_info swig_constants[] = { -{0,0,0,0,0,0} -}; -#ifdef __cplusplus -} -#endif -static swig_variable_info swig_variables[] = { -{0,0,0,0} -}; -static swig_command_info swig_commands[] = { -{"clinkgrammarc::lg_errinfo_severity_get", _wrap_lg_errinfo_severity_get}, -{"clinkgrammarc::lg_errinfo_severity_label_get", _wrap_lg_errinfo_severity_label_get}, -{"clinkgrammarc::lg_errinfo_text_get", _wrap_lg_errinfo_text_get}, -{"clinkgrammarc::new_lg_errinfo", _wrap_new_lg_errinfo}, -{"clinkgrammarc::linkgrammar_get_version", _wrap_linkgrammar_get_version}, -{"clinkgrammarc::linkgrammar_get_configuration", _wrap_linkgrammar_get_configuration}, -{"clinkgrammarc::linkgrammar_get_dict_version", _wrap_linkgrammar_get_dict_version}, -{"clinkgrammarc::linkgrammar_get_dict_locale", _wrap_linkgrammar_get_dict_locale}, -{"clinkgrammarc::dictionary_create_lang", _wrap_dictionary_create_lang}, -{"clinkgrammarc::dictionary_create_default_lang", _wrap_dictionary_create_default_lang}, -{"clinkgrammarc::dictionary_get_lang", _wrap_dictionary_get_lang}, -{"clinkgrammarc::dictionary_delete", _wrap_dictionary_delete}, -{"clinkgrammarc::dictionary_set_data_dir", _wrap_dictionary_set_data_dir}, -{"clinkgrammarc::dictionary_get_data_dir", _wrap_dictionary_get_data_dir}, -{"clinkgrammarc::parse_options_create", _wrap_parse_options_create}, -{"clinkgrammarc::parse_options_delete", _wrap_parse_options_delete}, -{"clinkgrammarc::parse_options_set_verbosity", _wrap_parse_options_set_verbosity}, -{"clinkgrammarc::parse_options_get_verbosity", _wrap_parse_options_get_verbosity}, -{"clinkgrammarc::parse_options_set_linkage_limit", _wrap_parse_options_set_linkage_limit}, -{"clinkgrammarc::parse_options_get_linkage_limit", _wrap_parse_options_get_linkage_limit}, -{"clinkgrammarc::parse_options_set_disjunct_cost", _wrap_parse_options_set_disjunct_cost}, -{"clinkgrammarc::parse_options_get_disjunct_cost", _wrap_parse_options_get_disjunct_cost}, -{"clinkgrammarc::parse_options_set_min_null_count", _wrap_parse_options_set_min_null_count}, -{"clinkgrammarc::parse_options_get_min_null_count", _wrap_parse_options_get_min_null_count}, -{"clinkgrammarc::parse_options_set_max_null_count", _wrap_parse_options_set_max_null_count}, -{"clinkgrammarc::parse_options_get_max_null_count", _wrap_parse_options_get_max_null_count}, -{"clinkgrammarc::parse_options_set_islands_ok", _wrap_parse_options_set_islands_ok}, -{"clinkgrammarc::parse_options_get_islands_ok", _wrap_parse_options_get_islands_ok}, -{"clinkgrammarc::parse_options_set_short_length", _wrap_parse_options_set_short_length}, -{"clinkgrammarc::parse_options_get_short_length", _wrap_parse_options_get_short_length}, -{"clinkgrammarc::parse_options_set_max_memory", _wrap_parse_options_set_max_memory}, -{"clinkgrammarc::parse_options_get_max_memory", _wrap_parse_options_get_max_memory}, -{"clinkgrammarc::parse_options_set_max_parse_time", _wrap_parse_options_set_max_parse_time}, -{"clinkgrammarc::parse_options_get_max_parse_time", _wrap_parse_options_get_max_parse_time}, -{"clinkgrammarc::parse_options_set_cost_model_type", _wrap_parse_options_set_cost_model_type}, -{"clinkgrammarc::parse_options_get_cost_model_type", _wrap_parse_options_get_cost_model_type}, -{"clinkgrammarc::parse_options_timer_expired", _wrap_parse_options_timer_expired}, -{"clinkgrammarc::parse_options_memory_exhausted", _wrap_parse_options_memory_exhausted}, -{"clinkgrammarc::parse_options_resources_exhausted", _wrap_parse_options_resources_exhausted}, -{"clinkgrammarc::parse_options_set_display_morphology", _wrap_parse_options_set_display_morphology}, -{"clinkgrammarc::parse_options_get_display_morphology", _wrap_parse_options_get_display_morphology}, -{"clinkgrammarc::parse_options_set_spell_guess", _wrap_parse_options_set_spell_guess}, -{"clinkgrammarc::parse_options_get_spell_guess", _wrap_parse_options_get_spell_guess}, -{"clinkgrammarc::parse_options_set_all_short_connectors", _wrap_parse_options_set_all_short_connectors}, -{"clinkgrammarc::parse_options_get_all_short_connectors", _wrap_parse_options_get_all_short_connectors}, -{"clinkgrammarc::parse_options_reset_resources", _wrap_parse_options_reset_resources}, -{"clinkgrammarc::parse_options_set_use_sat_parser", _wrap_parse_options_set_use_sat_parser}, -{"clinkgrammarc::parse_options_get_use_sat_parser", _wrap_parse_options_get_use_sat_parser}, -{"clinkgrammarc::sentence_create", _wrap_sentence_create}, -{"clinkgrammarc::sentence_delete", _wrap_sentence_delete}, -{"clinkgrammarc::sentence_split", _wrap_sentence_split}, -{"clinkgrammarc::sentence_parse", _wrap_sentence_parse}, -{"clinkgrammarc::sentence_length", _wrap_sentence_length}, -{"clinkgrammarc::sentence_null_count", _wrap_sentence_null_count}, -{"clinkgrammarc::sentence_num_linkages_found", _wrap_sentence_num_linkages_found}, -{"clinkgrammarc::sentence_num_valid_linkages", _wrap_sentence_num_valid_linkages}, -{"clinkgrammarc::sentence_num_linkages_post_processed", _wrap_sentence_num_linkages_post_processed}, -{"clinkgrammarc::sentence_num_violations", _wrap_sentence_num_violations}, -{"clinkgrammarc::sentence_disjunct_cost", _wrap_sentence_disjunct_cost}, -{"clinkgrammarc::sentence_link_cost", _wrap_sentence_link_cost}, -{"clinkgrammarc::linkage_create", _wrap_linkage_create}, -{"clinkgrammarc::linkage_delete", _wrap_linkage_delete}, -{"clinkgrammarc::linkage_print_diagram", _wrap_linkage_print_diagram}, -{"clinkgrammarc::linkage_print_postscript", _wrap_linkage_print_postscript}, -{"clinkgrammarc::linkage_print_links_and_domains", _wrap_linkage_print_links_and_domains}, -{"clinkgrammarc::linkage_print_senses", _wrap_linkage_print_senses}, -{"clinkgrammarc::linkage_print_constituent_tree", _wrap_linkage_print_constituent_tree}, -{"clinkgrammarc::linkage_print_disjuncts", _wrap_linkage_print_disjuncts}, -{"clinkgrammarc::linkage_print_pp_msgs", _wrap_linkage_print_pp_msgs}, -{"clinkgrammarc::linkage_get_num_words", _wrap_linkage_get_num_words}, -{"clinkgrammarc::linkage_get_num_links", _wrap_linkage_get_num_links}, -{"clinkgrammarc::linkage_get_link_lword", _wrap_linkage_get_link_lword}, -{"clinkgrammarc::linkage_get_link_rword", _wrap_linkage_get_link_rword}, -{"clinkgrammarc::linkage_get_link_length", _wrap_linkage_get_link_length}, -{"clinkgrammarc::linkage_get_link_label", _wrap_linkage_get_link_label}, -{"clinkgrammarc::linkage_get_link_llabel", _wrap_linkage_get_link_llabel}, -{"clinkgrammarc::linkage_get_link_rlabel", _wrap_linkage_get_link_rlabel}, -{"clinkgrammarc::linkage_get_link_num_domains", _wrap_linkage_get_link_num_domains}, -{"clinkgrammarc::linkage_get_link_domain_names", _wrap_linkage_get_link_domain_names}, -{"clinkgrammarc::linkage_get_words", _wrap_linkage_get_words}, -{"clinkgrammarc::linkage_get_word", _wrap_linkage_get_word}, -{"clinkgrammarc::linkage_get_word_byte_start", _wrap_linkage_get_word_byte_start}, -{"clinkgrammarc::linkage_get_word_byte_end", _wrap_linkage_get_word_byte_end}, -{"clinkgrammarc::linkage_get_word_char_start", _wrap_linkage_get_word_char_start}, -{"clinkgrammarc::linkage_get_word_char_end", _wrap_linkage_get_word_char_end}, -{"clinkgrammarc::linkage_unused_word_cost", _wrap_linkage_unused_word_cost}, -{"clinkgrammarc::linkage_disjunct_cost", _wrap_linkage_disjunct_cost}, -{"clinkgrammarc::linkage_link_cost", _wrap_linkage_link_cost}, -{"clinkgrammarc::linkage_corpus_cost", _wrap_linkage_corpus_cost}, -{"clinkgrammarc::linkage_get_violation_name", _wrap_linkage_get_violation_name}, -{"clinkgrammarc::_lg_error_formatmsg", _wrap__lg_error_formatmsg}, -{"clinkgrammarc::lg_error_clearall", _wrap_lg_error_clearall}, -{"clinkgrammarc::_prt_error", _wrap__prt_error}, -{"clinkgrammarc::lg_error_flush", _wrap_lg_error_flush}, -{0,0} -}; -/* ----------------------------------------------------------------------------- - * Type initialization: - * This problem is tough by the requirement that no dynamic - * memory is used. Also, since swig_type_info structures store pointers to - * swig_cast_info structures and swig_cast_info structures store pointers back - * to swig_type_info structures, we need some lookup code at initialization. - * The idea is that swig generates all the structures that are needed. - * The runtime then collects these partially filled structures. - * The SWIG_InitializeModule function takes these initial arrays out of - * swig_module, and does all the lookup, filling in the swig_module.types - * array with the correct data and linking the correct swig_cast_info - * structures together. - * - * The generated swig_type_info structures are assigned statically to an initial - * array. We just loop through that array, and handle each type individually. - * First we lookup if this type has been already loaded, and if so, use the - * loaded structure instead of the generated one. Then we have to fill in the - * cast linked list. The cast data is initially stored in something like a - * two-dimensional array. Each row corresponds to a type (there are the same - * number of rows as there are in the swig_type_initial array). Each entry in - * a column is one of the swig_cast_info structures for that type. - * The cast_initial array is actually an array of arrays, because each row has - * a variable number of columns. So to actually build the cast linked list, - * we find the array of casts associated with the type, and loop through it - * adding the casts to the list. The one last trick we need to do is making - * sure the type pointer in the swig_cast_info struct is correct. - * - * First off, we lookup the cast->type name to see if it is already loaded. - * There are three cases to handle: - * 1) If the cast->type has already been loaded AND the type we are adding - * casting info to has not been loaded (it is in this module), THEN we - * replace the cast->type pointer with the type pointer that has already - * been loaded. - * 2) If BOTH types (the one we are adding casting info to, and the - * cast->type) are loaded, THEN the cast info has already been loaded by - * the previous module so we just ignore it. - * 3) Finally, if cast->type has not already been loaded, then we add that - * swig_cast_info to the linked list (because the cast->type) pointer will - * be correct. - * ----------------------------------------------------------------------------- */ - -#ifdef __cplusplus -extern "C" { -#if 0 -} /* c-mode */ -#endif -#endif - -#if 0 -#define SWIGRUNTIME_DEBUG -#endif - - -SWIGRUNTIME void -SWIG_InitializeModule(void *clientdata) { - size_t i; - swig_module_info *module_head, *iter; - int init; - - /* check to see if the circular list has been setup, if not, set it up */ - if (swig_module.next==0) { - /* Initialize the swig_module */ - swig_module.type_initial = swig_type_initial; - swig_module.cast_initial = swig_cast_initial; - swig_module.next = &swig_module; - init = 1; - } else { - init = 0; - } - - /* Try and load any already created modules */ - module_head = SWIG_GetModule(clientdata); - if (!module_head) { - /* This is the first module loaded for this interpreter */ - /* so set the swig module into the interpreter */ - SWIG_SetModule(clientdata, &swig_module); - } else { - /* the interpreter has loaded a SWIG module, but has it loaded this one? */ - iter=module_head; - do { - if (iter==&swig_module) { - /* Our module is already in the list, so there's nothing more to do. */ - return; - } - iter=iter->next; - } while (iter!= module_head); - - /* otherwise we must add our module into the list */ - swig_module.next = module_head->next; - module_head->next = &swig_module; - } - - /* When multiple interpreters are used, a module could have already been initialized in - a different interpreter, but not yet have a pointer in this interpreter. - In this case, we do not want to continue adding types... everything should be - set up already */ - if (init == 0) return; - - /* Now work on filling in swig_module.types */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); -#endif - for (i = 0; i < swig_module.size; ++i) { - swig_type_info *type = 0; - swig_type_info *ret; - swig_cast_info *cast; - -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); -#endif - - /* if there is another module already loaded */ - if (swig_module.next != &swig_module) { - type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); - } - if (type) { - /* Overwrite clientdata field */ -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found type %s\n", type->name); -#endif - if (swig_module.type_initial[i]->clientdata) { - type->clientdata = swig_module.type_initial[i]->clientdata; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); -#endif - } - } else { - type = swig_module.type_initial[i]; - } - - /* Insert casting types */ - cast = swig_module.cast_initial[i]; - while (cast->type) { - /* Don't need to add information already in the list */ - ret = 0; -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); -#endif - if (swig_module.next != &swig_module) { - ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); -#ifdef SWIGRUNTIME_DEBUG - if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); -#endif - } - if (ret) { - if (type == swig_module.type_initial[i]) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: skip old type %s\n", ret->name); -#endif - cast->type = ret; - ret = 0; - } else { - /* Check for casting already in the list */ - swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); -#ifdef SWIGRUNTIME_DEBUG - if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); -#endif - if (!ocast) ret = 0; - } - } - - if (!ret) { -#ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); -#endif - if (type->cast) { - type->cast->prev = cast; - cast->next = type->cast; - } - type->cast = cast; - } - cast++; - } - /* Set entry in modules->types array equal to the type */ - swig_module.types[i] = type; - } - swig_module.types[i] = 0; - -#ifdef SWIGRUNTIME_DEBUG - printf("**** SWIG_InitializeModule: Cast List ******\n"); - for (i = 0; i < swig_module.size; ++i) { - int j = 0; - swig_cast_info *cast = swig_module.cast_initial[i]; - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); - while (cast->type) { - printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); - cast++; - ++j; - } - printf("---- Total casts: %d\n",j); - } - printf("**** SWIG_InitializeModule: Cast List ******\n"); -#endif -} - -/* This function will propagate the clientdata field of type to -* any new swig_type_info structures that have been added into the list -* of equivalent types. It is like calling -* SWIG_TypeClientData(type, clientdata) a second time. -*/ -SWIGRUNTIME void -SWIG_PropagateClientData(void) { - size_t i; - swig_cast_info *equiv; - static int init_run = 0; - - if (init_run) return; - init_run = 1; - - for (i = 0; i < swig_module.size; i++) { - if (swig_module.types[i]->clientdata) { - equiv = swig_module.types[i]->cast; - while (equiv) { - if (!equiv->converter) { - if (equiv->type && !equiv->type->clientdata) - SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); - } - equiv = equiv->next; - } - } - } -} - -#ifdef __cplusplus -#if 0 -{ - /* c-mode */ -#endif -} -#endif - - - -#if defined(__cplusplus) && ! defined(XSPROTO) -extern "C" -#endif - -XS(SWIG_init) { - dXSARGS; - int i; - (void)items; - - SWIG_InitializeModule(0); - - /* Install commands */ - for (i = 0; swig_commands[i].name; i++) { - /* Casts only needed for Perl < 5.10. */ -#ifdef __cplusplus - newXS(const_cast(swig_commands[i].name), swig_commands[i].wrapper, const_cast(__FILE__)); -#else - newXS((char*)swig_commands[i].name, swig_commands[i].wrapper, (char*)__FILE__); -#endif - } - - /* Install variables */ - for (i = 0; swig_variables[i].name; i++) { - SV *sv; - sv = get_sv(swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI); - if (swig_variables[i].type) { - SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); - } else { - sv_setiv(sv,(IV) 0); - } - swig_create_magic(sv, swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); - } - - /* Install constant */ - for (i = 0; swig_constants[i].type; i++) { - SV *sv; - sv = get_sv(swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI); - switch(swig_constants[i].type) { - case SWIG_INT: - sv_setiv(sv, (IV) swig_constants[i].lvalue); - break; - case SWIG_FLOAT: - sv_setnv(sv, (double) swig_constants[i].dvalue); - break; - case SWIG_STRING: - sv_setpv(sv, (const char *) swig_constants[i].pvalue); - break; - case SWIG_POINTER: - SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); - break; - case SWIG_BINARY: - SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); - break; - default: - break; - } - SvREADONLY_on(sv); - } - - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Fatal", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Fatal))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Error", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Error))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Warn", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Warn))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Info", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Info))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Debug", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Debug))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_Trace", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_Trace))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "lg_None", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(lg_None))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - SWIG_TypeClientData(SWIGTYPE_p_lg_errinfo, (void*) "clinkgrammar::lg_errinfo"); - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "VDAL", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(VDAL))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "CORPUS", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(CORPUS))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "NO_DISPLAY", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(NO_DISPLAY))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MULTILINE", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MULTILINE))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "BRACKET_TREE", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(BRACKET_TREE))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "SINGLE_LINE", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(SINGLE_LINE))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig3.0/perl5/perltypemaps.swg,65,%set_constant@*/ do { - SV *sv = get_sv((char*) SWIG_prefix "MAX_STYLES", TRUE | 0x2 | GV_ADDMULTI); - sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(MAX_STYLES))); - SvREADONLY_on(sv); - } while(0) /*@SWIG@*/; - ST(0) = &PL_sv_yes; - XSRETURN(1); -} - diff --git a/bindings/python-examples/Makefile.am b/bindings/python-examples/Makefile.am index 13bb8e0..baacfbf 100644 --- a/bindings/python-examples/Makefile.am +++ b/bindings/python-examples/Makefile.am @@ -21,8 +21,13 @@ EXTRA_DIST = \ README.md \ example.py \ sentence-check.py \ + parses-demo-sql.txt \ parses-en.txt \ parses-lt.txt \ + parses-pos-en.txt \ + parses-pos-he.txt \ + parses-pos-ru.txt \ + parses-pos-spell-en.txt \ parses-quotes-en.txt \ parses-sat-en.txt \ lg_testutils.py \ diff --git a/bindings/python-examples/Makefile.in b/bindings/python-examples/Makefile.in index 08b6aad..7ef3ac8 100644 --- a/bindings/python-examples/Makefile.in +++ b/bindings/python-examples/Makefile.in @@ -531,8 +531,13 @@ EXTRA_DIST = \ README.md \ example.py \ sentence-check.py \ + parses-demo-sql.txt \ parses-en.txt \ parses-lt.txt \ + parses-pos-en.txt \ + parses-pos-he.txt \ + parses-pos-ru.txt \ + parses-pos-spell-en.txt \ parses-quotes-en.txt \ parses-sat-en.txt \ lg_testutils.py \ diff --git a/bindings/python-examples/README.md b/bindings/python-examples/README.md index ff0734c..2f6a42c 100644 --- a/bindings/python-examples/README.md +++ b/bindings/python-examples/README.md @@ -69,8 +69,8 @@ configured with the SAT solver (this is currently the case for native Windows builds). The test procedure is outlined below. For native Windows/MinGW, see -the `msvc14/README.md` file: -[Running Python programs in Windows](/msvc14/README.md#running-python-programs). +the `msvc/README.md` file: +[Running Python programs in Windows](/msvc/README.md#running-python-programs). ### Testing the build directory The following is assumed: diff --git a/bindings/python-examples/lg_testutils.py b/bindings/python-examples/lg_testutils.py index 8bd057d..ed2c29a 100644 --- a/bindings/python-examples/lg_testutils.py +++ b/bindings/python-examples/lg_testutils.py @@ -7,7 +7,7 @@ def add_eqcost_linkage_order(original_class): be in a deterministic order. Usage: lg_testutils.add_eqcost_linkage_order(Sentence) """ - class eqcost_soretd_parse(original_class.sentence_parse): + class eqcost_sorted_parse(original_class.sentence_parse): """ Sort equal-cost linkages according to the alphabetic order of their diagram string, on demand. We need it because the order of linkages @@ -73,6 +73,6 @@ def add_eqcost_linkage_order(original_class): # parse() has an optional single argument for parse options. If it is not given, # call original_parse() also without arguments in order to test it that way. linkages = self.original_parse() if parse_options is None else self.original_parse(parse_options) - return eqcost_soretd_parse(linkages) + return eqcost_sorted_parse(linkages) original_class.parse = parse diff --git a/bindings/python-examples/parses-demo-sql.txt b/bindings/python-examples/parses-demo-sql.txt new file mode 100644 index 0000000..3d7e586 --- /dev/null +++ b/bindings/python-examples/parses-demo-sql.txt @@ -0,0 +1,19 @@ +% This file contains test sentences to verify that the SQL dict +% works. It contains more than one sentence to check that memory +% is freed properly (e.g by using LSAN). + +Ithis is a test +O +O +------WV------+--Osm--+ +O +---Wd---+-Ss*b+ +-Ds-+ +O | | | | | +OLEFT-WALL this.p is.v a test.n +O + +Ithis is another test +O +O +------WV------+-----Osm-----+ +O +---Wd---+-Ss*b+ +---Ds--+ +O | | | | | +OLEFT-WALL this.p is.v another test.n +O diff --git a/bindings/python-examples/parses-en.txt b/bindings/python-examples/parses-en.txt index f5f05a9..253351f 100644 --- a/bindings/python-examples/parses-en.txt +++ b/bindings/python-examples/parses-en.txt @@ -40,8 +40,8 @@ C IY'gotta do it this way O -O +---->WV---->+ +------MVa-----+ -O +->Wd--+-Sp*i+--I*t--+Osm+ +-Dsu-+ -O | | | | | | | -OLEFT-WALL y' gotta.v-d do.v it this.d way.n +O +------->WV------>+ +------MVa-----+ +O +-->Wd---+--Sp*i--+--I*t--+Osm+ +-Dsu-+ +O | | | | | | | +OLEFT-WALL y'.#you gotta.v-d do.v it this.d way.n O diff --git a/bindings/python-examples/parses-pos-en.txt b/bindings/python-examples/parses-pos-en.txt new file mode 100644 index 0000000..9b8cda7 --- /dev/null +++ b/bindings/python-examples/parses-pos-en.txt @@ -0,0 +1,56 @@ +% This file contains test sentences, and the expected positions (start, end) +% of their words. The first P line is char position, and the second one is +% byte position. + +Ithis is a test +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) a(8, 9) test.n(10, 14) RIGHT-WALL(14, 14) +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) a(8, 9) test.n(10, 14) RIGHT-WALL(14, 14) +P +% Middle extra whitespace. +Ithis is a test +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) a(8, 9) test.n(11, 15) RIGHT-WALL(15, 15) +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) a(8, 9) test.n(11, 15) RIGHT-WALL(15, 15) +P +% Initial whitespace. +I this is a test +PLEFT-WALL(0, 0) this.p(1, 5) is.v(6, 8) a(9, 10) test.n(11, 15) RIGHT-WALL(15, 15) +PLEFT-WALL(0, 0) this.p(1, 5) is.v(6, 8) a(9, 10) test.n(11, 15) RIGHT-WALL(15, 15) +P + +% Various kinds of input splits. +Iit's a test. +PLEFT-WALL(0, 0) it(0, 2) 's.v(2, 4) a(5, 6) test.n(7, 11) .(11, 12) RIGHT-WALL(12, 12) +PLEFT-WALL(0, 0) it(0, 2) 's.v(2, 4) a(5, 6) test.n(7, 11) .(11, 12) RIGHT-WALL(12, 12) +P + +Ithis is--a test +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) --.r(7, 9) a(9, 10) test.n(11, 15) RIGHT-WALL(15, 15) +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) --.r(7, 9) a(9, 10) test.n(11, 15) RIGHT-WALL(15, 15) +P + +% A different byte and char positions for non-ASCII. +II love going to the café. +PLEFT-WALL(0, 0) I.p(0, 1) love.v(2, 6) going.v(7, 12) to.r(13, 15) the(16, 19) café.n(20, 24) .(24, 25) RIGHT-WALL(25, 25) +PLEFT-WALL(0, 0) I.p(0, 1) love.v(2, 6) going.v(7, 12) to.r(13, 15) the(16, 19) café.n(20, 25) .(25, 26) RIGHT-WALL(26, 26) +P + +% Test linkages w/null-linked words +-max_null_count=1 + +IThis is a the test +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) [a](8, 9) the(10, 13) test.n(14, 18) RIGHT-WALL(18, 18) +PLEFT-WALL(0, 0) this.p(0, 4) is.v(5, 7) [a](8, 9) the(10, 13) test.n(14, 18) RIGHT-WALL(18, 18) +P + +% Here "As" gets split by the tokenizer into 2 alternatives: +% 1: As +% 2: A.u s.u +% There is no full linkage, and in order to show the result in a reasonable +% way (this is most beneficial if there are more then two such alternatives) +% the library combines back the failed splits and should recalculate +% the word position of these combined splits correctly. + +IAs no linkage +PLEFT-WALL(0, 0) [as](0, 2) no.ij(3, 5) linkage.n-u(6, 13) RIGHT-WALL(13, 13) +PLEFT-WALL(0, 0) [as](0, 2) no.ij(3, 5) linkage.n-u(6, 13) RIGHT-WALL(13, 13) +P diff --git a/bindings/python-examples/parses-pos-he.txt b/bindings/python-examples/parses-pos-he.txt new file mode 100644 index 0000000..09e1a50 --- /dev/null +++ b/bindings/python-examples/parses-pos-he.txt @@ -0,0 +1,12 @@ +% For the file purpose and format see parses-pos-en.txt. + +Iהכלב רץ מהחצר +PLEFT-WALL(0, 0) (0, 1) הכלב(0, 4) רץ(5, 7) (8, 9) (9, 10) מהחצר(8, 13) +PLEFT-WALL(0, 0) (0, 2) הכלב(0, 8) רץ(9, 13) (14, 16) (16, 18) מהחצר(14, 24) +P + +-display_morphology = True +Iהכלב רץ מהחצר +PLEFT-WALL(0, 0) ה=(0, 1) כלב(1, 4) רץ(5, 7) מ=(8, 9) ה=(9, 10) חצר(10, 13) +PLEFT-WALL(0, 0) ה=(0, 2) כלב(2, 8) רץ(9, 13) מ=(14, 16) ה=(16, 18) חצר(18, 24) +P diff --git a/bindings/python-examples/parses-pos-ru.txt b/bindings/python-examples/parses-pos-ru.txt new file mode 100644 index 0000000..45f7a05 --- /dev/null +++ b/bindings/python-examples/parses-pos-ru.txt @@ -0,0 +1,12 @@ +% For the file purpose and format see parses-pos-en.txt. + +Iэто тести +PLEFT-WALL(0, 0) это.msi(0, 3) тести.nlmpi(4, 9) RIGHT-WALL(9, 9) +PLEFT-WALL(0, 0) это.msi(0, 6) тести.nlmpi(7, 17) RIGHT-WALL(17, 17) +P + +-display_morphology = True +Iэто тести +PLEFT-WALL(0, 0) это.msi(0, 3) тест.=(4, 8) =и.nlmpi(8, 9) RIGHT-WALL(9, 9) +PLEFT-WALL(0, 0) это.msi(0, 6) тест.=(7, 15) =и.nlmpi(15, 17) RIGHT-WALL(17, 17) +P diff --git a/bindings/python-examples/parses-pos-spell-en.txt b/bindings/python-examples/parses-pos-spell-en.txt new file mode 100644 index 0000000..d0c5744 --- /dev/null +++ b/bindings/python-examples/parses-pos-spell-en.txt @@ -0,0 +1,23 @@ +% This file contains test sentences, and the expected positions (start, end) +% of their words. The first P line is char position, and the second one is +% byte position. + +% Validate that the linkage words that are a result of a spell guess have +% the position of the original sentence words. + +% The word "seasand" gets broken in 2 possibilities. +Ithe seasand lakes are hot +PLEFT-WALL(0, 0) the(0, 3) seas[&].n(4, 8) and[&].j-n(8, 11) lakes.n(12, 17) are.v(18, 21) hot.a(22, 25) RIGHT-WALL(25, 25) +PLEFT-WALL(0, 0) the(0, 3) seas[&].n(4, 8) and[&].j-n(8, 11) lakes.n(12, 17) are.v(18, 21) hot.a(22, 25) RIGHT-WALL(25, 25) +P +N +PLEFT-WALL(0, 0) the(0, 3) sea[&].n-u(4, 7) sand[&].n-u(7, 11) lakes.n(12, 17) are.v(18, 21) hot.a(22, 25) RIGHT-WALL(25, 25) +PLEFT-WALL(0, 0) the(0, 3) sea[&].n-u(4, 7) sand[&].n-u(7, 11) lakes.n(12, 17) are.v(18, 21) hot.a(22, 25) RIGHT-WALL(25, 25) +P + +% The following misspelled word has only one possible spell guess. +% (This is needed because we check here only the first linkage.) +II love going to a zooo. +PLEFT-WALL(0, 0) I.p(0, 1) love.v(2, 6) going.v(7, 12) to.r(13, 15) a(16, 17) zoo[~].n(18, 22) .(22, 23) RIGHT-WALL(23, 23) +PLEFT-WALL(0, 0) I.p(0, 1) love.v(2, 6) going.v(7, 12) to.r(13, 15) a(16, 17) zoo[~].n(18, 22) .(22, 23) RIGHT-WALL(23, 23) +P diff --git a/bindings/python-examples/parses-sat-en.txt b/bindings/python-examples/parses-sat-en.txt index 3eb1de9..da380cd 100644 --- a/bindings/python-examples/parses-sat-en.txt +++ b/bindings/python-examples/parses-sat-en.txt @@ -1,7 +1,7 @@ % This file contains test cases for the SAT solver, % to validate that it works. % Since the SAT solver doesn't order (for now) its solutions -% according to cost, this is just the solution it omits first +% according to cost, this is just the solution it emits first % for the given sentence. Ithis is a test diff --git a/bindings/python-examples/sentence-check.py b/bindings/python-examples/sentence-check.py index 90b6591..c12b080 100755 --- a/bindings/python-examples/sentence-check.py +++ b/bindings/python-examples/sentence-check.py @@ -18,15 +18,22 @@ Sentence has 1 unlinked word: 3: LEFT-WALL this.p is.v [a] the test.n of bfgiuing[!].g and.j-n xxxvfrg[?].a RIGHT-WALL 4: LEFT-WALL this.p is.v a [the] test.n of bfgiuing[!].g and.j-n xxxvfrg[?].a RIGHT-WALL """ + from __future__ import print_function import sys +from sys import stdin import re -import itertools import argparse +import readline from linkgrammar import (Sentence, ParseOptions, Dictionary, LG_Error, LG_TimerExhausted, Clinkgrammar as clg) +def is_python2(): + return sys.version_info[:1] == (2,) + +get_input = raw_input if is_python2() else input + def nsuffix(q): return '' if q == 1 else 's' @@ -38,7 +45,13 @@ class Formatter(argparse.HelpFormatter): #-----------------------------------------------------------------------------# +is_stdin_atty = sys.stdin.isatty() + +PROMPT = "sentence-check: " if is_stdin_atty else "" DISPLAY_GUESSES = True # Display regex and POS guesses +BATCH_LABELS = '*: ' + +print ("Version:", clg.linkgrammar_get_version()) args = argparse.ArgumentParser(formatter_class=Formatter) args.add_argument('lang', nargs='?', default='en', @@ -50,6 +63,8 @@ args.add_argument("-p", "--position", action="store_true", help="show word sentence position") args.add_argument("-nm", "--no-morphology", dest='morphology', action='store_false', help="do not display morphology") +args.add_argument("-i", "--interactive", action="store_true", + help="interactive mode after each result") arg = args.parse_args() @@ -67,11 +82,25 @@ po.max_parse_time = 10 # actual parse timeout may be about twice bigger po.spell_guess = True if DISPLAY_GUESSES else False po.display_morphology = arg.morphology -print("Enter sentences:") -# iter(): avoid python2 input buffering -for sentence_text in iter(sys.stdin.readline, ''): +while True: + try: + sentence_text = get_input(PROMPT) + except EOFError: + print("EOF") + exit(0) + + if not is_stdin_atty and sentence_text: + if sentence_text[0] == '%': + continue + if sentence_text[0] == '!': # ignore user-settings for now + continue + if sentence_text[0] in BATCH_LABELS: + sentence_text = sentence_text[1:] if sentence_text.strip() == '': continue + if not is_stdin_atty: + print("\n" + sentence_text) + sent = Sentence(str(sentence_text), lgdict, po) try: linkages = sent.parse() @@ -86,53 +115,70 @@ for sentence_text in iter(sys.stdin.readline, ''): print('Cannot parse the input sentence') continue null_count = sent.null_count() + + if arg.position: + print(' ' * len(PROMPT), end='') + for p in range (0, len(sentence_text)): + print(p%10, end="") + print() + + if null_count == 0: + print("Sentence parsed OK", end='') + + linkages = list(linkages) + + correction_found = False + # search for correction suggestions + for l in linkages: + for word in l.words(): + if word.find(r'.#') > 0: + correction_found = True + break + if correction_found: + break + + if correction_found: + print(" - with correction", end='') if null_count == 0: - print("Sentence parsed OK") + print(".") guess_found = False if DISPLAY_GUESSES: - linkages, check_first = itertools.tee(linkages) # Check the first linkage for regexed/unknown words - linkage = next(check_first) - for word in list(linkage.words()): + for word in linkages[0].words(): # search for something[x] if re.search(r'\S+\[[^]]+]', word): guess_found = True break # Show results with unlinked words or guesses - if not arg.position and not guess_found and null_count == 0: - continue - - - if arg.position: - for p in range (0, len(sentence_text)): - print(p%10, end="") - print() - - print('Sentence has {} unlinked word{}:'.format( - null_count, nsuffix(null_count))) - result_no = 0 - uniqe_parse = {} - for linkage in linkages: - words = list(linkage.words()) - if str(words) in uniqe_parse: - continue - result_no += 1 - uniqe_parse[str(words)] = True - - if arg.position: - words_char = [] - words_byte = [] - wi = 0 - for w in words: - if sys.version_info < (3, 0): - words[wi] = words[wi].decode('utf-8') - words_char.append(words[wi] + str((linkage.word_char_start(wi), linkage.word_char_end(wi)))) - words_byte.append(words[wi] + str((linkage.word_byte_start(wi), linkage.word_byte_end(wi)))) - wi += 1 - - print(u"{}: {}".format(result_no, ' '.join(words_char))) - print(u"{}: {}".format(result_no, ' '.join(words_byte))) - else: - print("{}: {}".format(result_no, ' '.join(words))) + if arg.position or guess_found or correction_found or null_count != 0: + print('Sentence has {} unlinked word{}:'.format( + null_count, nsuffix(null_count))) + result_no = 0 + uniqe_parse = {} + for linkage in linkages: + words = list(linkage.words()) + if str(words) in uniqe_parse: + continue + result_no += 1 + uniqe_parse[str(words)] = True + + if arg.position: + words_char = [] + words_byte = [] + for wi, w in enumerate(words): + if is_python2(): + w = w.decode('utf-8') + words_char.append(w + str((linkage.word_char_start(wi), linkage.word_char_end(wi)))) + words_byte.append(w + str((linkage.word_byte_start(wi), linkage.word_byte_end(wi)))) + + print(u"{}: {}".format(result_no, ' '.join(words_char))) + print(u"{}: {}".format(result_no, ' '.join(words_byte))) + else: + print("{}: {}".format(result_no, ' '.join(words))) + + if arg.interactive: + print("Interactive session (^D to end):") + import code + code.interact(local=locals()) diff --git a/bindings/python-examples/tests.py b/bindings/python-examples/tests.py index d509846..81e9d53 100755 --- a/bindings/python-examples/tests.py +++ b/bindings/python-examples/tests.py @@ -248,14 +248,15 @@ class CParseOptionsTestCase(unittest.TestCase): class DBasicParsingTestCase(unittest.TestCase): @classmethod def setUpClass(cls): - cls.d = Dictionary() + cls.d, cls.po = Dictionary(), None @classmethod def tearDownClass(cls): - del cls.d - del cls.parse_sent + del cls.d, cls.po - def parse_sent(self, text, po=ParseOptions()): + def parse_sent(self, text, po=None): + if po is None: + po = ParseOptions() return list(Sentence(text, self.d, po).parse()) def test_that_parse_returns_empty_iterator_on_no_linkage(self): @@ -284,34 +285,34 @@ class DBasicParsingTestCase(unittest.TestCase): def test_utf8_encoded_string(self): result = self.parse_sent("I love going to the café.") - self.assertTrue(1 < len(result)) + self.assertTrue(len(result) > 1) self.assertTrue(isinstance(result[0], Linkage)) self.assertTrue(isinstance(result[1], Linkage)) # def test_unicode_encoded_string(self): - if sys.version_info > (3, 0): - result = self.parse_sent(u"I love going to the caf\N{LATIN SMALL LETTER E WITH ACUTE}.") - else: + if is_python2(): result = self.parse_sent(u"I love going to the caf\N{LATIN SMALL LETTER E WITH ACUTE}.".encode('utf8')) - self.assertTrue(1 < len(result)) + else: + result = self.parse_sent(u"I love going to the caf\N{LATIN SMALL LETTER E WITH ACUTE}.") + self.assertTrue(len(result) > 1) self.assertTrue(isinstance(result[0], Linkage)) self.assertTrue(isinstance(result[1], Linkage)) # def test_unknown_word(self): result = self.parse_sent("I love going to the qertfdwedadt.") - self.assertTrue(1 < len(result)) + self.assertTrue(len(result) > 1) self.assertTrue(isinstance(result[0], Linkage)) self.assertTrue(isinstance(result[1], Linkage)) # def test_unknown_euro_utf8_word(self): result = self.parse_sent("I love going to the qéáéğíóşúüñ.") - self.assertTrue(1 < len(result)) + self.assertTrue(len(result) > 1) self.assertTrue(isinstance(result[0], Linkage)) self.assertTrue(isinstance(result[1], Linkage)) # def test_unknown_cyrillic_utf8_word(self): result = self.parse_sent("I love going to the доктором.") - self.assertTrue(1 < len(result)) + self.assertTrue(len(result) > 1) self.assertTrue(isinstance(result[0], Linkage)) self.assertTrue(isinstance(result[1], Linkage)) @@ -322,11 +323,27 @@ class DBasicParsingTestCase(unittest.TestCase): self.assertEqual([len(l) for l in linkage.links()], [6,2,1,1,3,2,1,1,1]) def test_dictionary_locale_definition(self): + if is_python2(): # Locale stuff seems to be broken + raise unittest.SkipTest("Test not supported with Python2") + + # python2: Gets system locale (getlocale() is not better) + oldlocale = locale.setlocale(locale.LC_CTYPE, None) + #print('Current locale:', oldlocale) + #print('toupper hij:', 'hij'.upper()) + tr_locale = 'tr_TR.UTF-8' if os.name != 'nt' else 'Turkish' - oldlocale = locale.setlocale(locale.LC_CTYPE, tr_locale) + locale.setlocale(locale.LC_CTYPE, tr_locale) + #print('Turkish locale:', locale.setlocale(locale.LC_CTYPE, None)) + + # python2: prints HiJ (lowercase small i in the middle) + #print('toupper hij:', 'hij'.upper()) + self.assertEqual(list(self.parse_sent('Is it fine?')[0].words()), - ['LEFT-WALL', 'is.v', 'it', 'fine.a', '?', 'RIGHT-WALL']) + ['LEFT-WALL', 'is.v', 'it', 'fine.a', '?', 'RIGHT-WALL']) + locale.setlocale(locale.LC_CTYPE, oldlocale) + #print("Restored locale:", locale.setlocale(locale.LC_CTYPE)) + #print('toupper hij:', 'hij'.upper()) # If \w is supported, other \ shortcuts are hopefully supported too. def test_regex_class_shortcut_support(self): @@ -340,7 +357,7 @@ class DBasicParsingTestCase(unittest.TestCase): "This should take more than one second to parse! " * 20, ParseOptions(max_parse_time=1)) -# The tests here are are numbered since their order is important. +# The tests here are numbered since their order is important. # They depend on the result and state of the previous ones as follows: # - set_handler() returned a value that depend on it previous invocation. # - A class variable "handler" to record its previous results. @@ -351,9 +368,11 @@ class EErrorFacilityTestCase(unittest.TestCase): "previous": lambda x, y=None: None } - def setUp(self): # pylint: disable=attribute-defined-outside-init,no-member + def setUp(self): self.testit = "testit" self.testleaks = 0 # A repeat count for validating no memory leaks + self.numerr = 0 + self.errinfo = clg.lg_None @staticmethod def error_handler_test(errinfo, data): @@ -388,9 +407,9 @@ class EErrorFacilityTestCase(unittest.TestCase): self.gotit = None for i in range(0, 2+self.testleaks): self.numerr = LG_Error.printall(self.error_handler_test, self) - if 0 == i: + if i == 0: self.assertEqual(self.numerr, 1) - if 1 == i: + if i == 1: self.assertEqual(self.numerr, 0) self.assertEqual((self.errinfo.severity, self.errinfo.severity_label), (clg.lg_Error, "Error")) self.assertEqual(self.gotit, "testit") @@ -537,8 +556,7 @@ class HEnglishLinkageTestCase(unittest.TestCase): @classmethod def tearDownClass(cls): - del cls.d - del cls.po + del cls.d, cls.po def parse_sent(self, text): return list(Sentence(text, self.d, self.po).parse()) @@ -712,6 +730,50 @@ class HEnglishLinkageTestCase(unittest.TestCase): "\nLEFT-WALL we are.v from the planet.n Gorpon[!]" "\n\n") +class GSQLDictTestCase(unittest.TestCase): + @classmethod + def setUpClass(cls): + #clg.parse_options_set_verbosity(clg.parse_options_create(), 3) + cls.d, cls.po = Dictionary(lang='demo-sql'), ParseOptions() + + @classmethod + def tearDownClass(cls): + del cls.d, cls.po + + def test_getting_links(self): + linkage_testfile(self, self.d, self.po) + + def test_getting_links_sat(self): + sat_po = ParseOptions(use_sat=True) + if sat_po.use_sat != True: + raise unittest.SkipTest("Library not configured with SAT parser") + linkage_testfile(self, self.d, sat_po) + +class IWordPositionTestCase(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.d_en = Dictionary(lang='en') + + @classmethod + def tearDownClass(cls): + del cls.d_en + + def test_en_word_positions(self): + linkage_testfile(self, self.d_en, ParseOptions(), 'pos') + + def test_en_spell_word_positions(self): + po = ParseOptions(spell_guess=1) + if po.spell_guess == 0: + raise unittest.SkipTest("Library is not configured with spell guess") + linkage_testfile(self, self.d_en, po, 'pos-spell') + + def test_ru_word_positions(self): + linkage_testfile(self, Dictionary(lang='ru'), ParseOptions(), 'pos') + + def test_he_word_positions(self): + linkage_testfile(self, Dictionary(lang='he'), ParseOptions(), 'pos') + +# Tests are run in alphabetical order; do the language tests last. class ZENLangTestCase(unittest.TestCase): @classmethod @@ -720,8 +782,7 @@ class ZENLangTestCase(unittest.TestCase): @classmethod def tearDownClass(cls): - del cls.d - del cls.po + del cls.d, cls.po def test_getting_links(self): linkage_testfile(self, self.d, self.po) @@ -770,10 +831,9 @@ class ZENConstituentsCase(unittest.TestCase): @classmethod def tearDownClass(cls): - del cls.d - del cls.po + del cls.d, cls.po - def test_a_constiuents_after_parse_list(self): + def test_a_constituents_after_parse_list(self): """ Validate that the post-processing data of the first linkage is not getting clobbered by later linkages. @@ -782,7 +842,6 @@ class ZENConstituentsCase(unittest.TestCase): self.assertEqual(linkages[0].constituent_tree(), "(S (NP this.p)\n (VP is.v\n (NP a test.n))\n .)\n") -# Tests are run in alphabetical order; do the language tests last. class ZDELangTestCase(unittest.TestCase): @classmethod def setUpClass(cls): @@ -790,8 +849,7 @@ class ZDELangTestCase(unittest.TestCase): @classmethod def tearDownClass(cls): - del cls.d - del cls.po + del cls.d, cls.po def parse_sent(self, text): return list(Sentence(text, self.d, self.po).parse()) @@ -838,8 +896,7 @@ class ZRULangTestCase(unittest.TestCase): @classmethod def tearDownClass(cls): - del cls.d - del cls.po + del cls.d, cls.po def parse_sent(self, text): return list(Sentence(text, self.d, self.po).parse()) @@ -887,73 +944,111 @@ def linkage_testfile(self, lgdict, popt, desc = ''): linkage diagrams / constituent printings. """ self.__class__.longMessage = True - if '' != desc: + self.maxDiff = None + if desc != '': desc = desc + '-' testfile = clg.test_data_srcdir + "parses-" + desc + clg.dictionary_get_lang(lgdict._obj) + ".txt" parses = open(testfile, "rb") diagram = None constituents = None + wordpos = None sent = None lineno = 0 + last_opcode = None + + def getwordpos(lkg): + words_char = [] + words_byte = [] + for wi, w in enumerate(lkg.words()): + words_char.append(w + str((linkage.word_char_start(wi), linkage.word_char_end(wi)))) + words_byte.append(w + str((linkage.word_byte_start(wi), linkage.word_byte_end(wi)))) + return ' '.join(words_char) + '\n' + ' '.join(words_byte) + '\n' # Function code and file format sanity check - self.opcode_detected = 0 - def validate_opcode(ctxt=self, O=False, C=False): - ctxt.opcode_detected += 1 - if O: + def validate_opcode(opcode): + if opcode != ord('O'): self.assertFalse(diagram, "at {}:{}: Unfinished diagram entry".format(testfile, lineno)) - if C: + if opcode != ord('C'): self.assertFalse(constituents, "at {}:{}: Unfinished constituents entry".format(testfile, lineno)) + if opcode != ord('P'): + self.assertFalse(wordpos, "at {}:{}: Unfinished word-position entry".format(testfile, lineno)) for line in parses: lineno += 1 - if sys.version_info > (3, 0): + if not is_python2(): line = line.decode('utf-8') + + validate_opcode(ord(line[0])) # Use ord() for python2/3 compatibility + prev_opcode = last_opcode + if line[0] in 'INOCP': + last_opcode = line[0] + # Lines starting with I are the input sentences - if 'I' == line[0]: - validate_opcode(O=True, C=True) - sent = line[1:] + if line[0] == 'I': + sent = line[1:].rstrip('\r\n') # Strip whitespace before RIGHT-WALL (for P) diagram = "" constituents = "" + wordpos = "" linkages = Sentence(sent, lgdict, popt).parse() linkage = next(linkages, None) self.assertTrue(linkage, "at {}:{}: Sentence has no linkages".format(testfile, lineno)) # Generate the next linkage of the last input sentence - if 'N' == line[0]: - validate_opcode(O=True, C=True) + elif line[0] == 'N': diagram = "" constituents = "" + wordpos = "" linkage = next(linkages, None) self.assertTrue(linkage, "at {}:{}: Sentence has too few linkages".format(testfile, lineno)) # Lines starting with O are the parse diagram # It ends with an empty line - if 'O' == line[0]: - validate_opcode(C=True) + elif line[0] == 'O': diagram += line[1:] - if '\n' == line[1] and 1 < len(diagram): + if line[1] == '\n' and len(diagram) > 1: self.assertEqual(linkage.diagram(), diagram, "at {}:{}".format(testfile, lineno)) diagram = None # Lines starting with C are the constituent output (type 1) # It ends with an empty line - if 'C' == line[0]: - validate_opcode(O=True) - if '\n' == line[1] and 1 < len(constituents): + elif line[0] == 'C': + if line[1] == '\n' and len(constituents) > 1: self.assertEqual(linkage.constituent_tree(), constituents, "at {}:{}".format(testfile, lineno)) constituents = None else: constituents += line[1:] + + # Lines starting with P contain word positions "word(start, end) ... " + # The first P line contains character positions + # The second P line contains byte positions + # It ends with an empty line + elif line[0] == 'P': + if line[1] == '\n' and len(wordpos) > 1: + self.assertEqual(getwordpos(linkage), wordpos, "at {}:{}".format(testfile, lineno)) + wordpos = None + else: + wordpos += line[1:] + + # Lines starting with "-" contain a Parse Option + elif line[0] == '-': + exec('popt.' + line[1:], None, locals()) + + elif line[0] in '%\r\n': + pass + else: + self.fail('\nTest file "{}": Invalid opcode "{}" (ord={})'.format(testfile, line[0], ord(line[0]))) + parses.close() - validate_opcode(O=True, C=True) - self.assertGreaterEqual(self.opcode_detected, 2, "Nothing has been done for " + testfile) + self.assertIn(last_opcode , 'OCP', "Missing result comparison in " + testfile) def warning(*msg): progname = os.path.basename(sys.argv[0]) print("{}: Warning:".format(progname), *msg, file=sys.stderr) +def is_python2(): + return sys.version_info[:1] == (2,) + import tempfile @@ -983,7 +1078,7 @@ class divert_start(object): __del__ = divert_end -# Decorate Sentence.parse with eqcost_soretd_parse. +# Decorate Sentence.parse with eqcost_sorted_parse. lg_testutils.add_eqcost_linkage_order(Sentence) unittest.main() diff --git a/bindings/python/__init__.py b/bindings/python/__init__.py index d201c59..ed3e2d5 100644 --- a/bindings/python/__init__.py +++ b/bindings/python/__init__.py @@ -1,6 +1,6 @@ # # __init__.py file for Link Grammar Python bindings # -__version__ = "5.5.0" +__version__ = "5.5.1" from .linkgrammar import * diff --git a/bindings/python/clinkgrammar.py b/bindings/python/clinkgrammar.py index 7fa6da0..540ed4c 100644 --- a/bindings/python/clinkgrammar.py +++ b/bindings/python/clinkgrammar.py @@ -519,6 +519,14 @@ _py_error_printall = _clinkgrammar._py_error_printall def delete_lg_errinfo(lge): return _clinkgrammar.delete_lg_errinfo(lge) delete_lg_errinfo = _clinkgrammar.delete_lg_errinfo + +def _py_incref(x): + return _clinkgrammar._py_incref(x) +_py_incref = _clinkgrammar._py_incref + +def _py_decref(x): + return _clinkgrammar._py_decref(x) +_py_decref = _clinkgrammar._py_decref # This file is compatible with both classic and new-style classes. diff --git a/bindings/python/lg_python_wrap.cc b/bindings/python/lg_python_wrap.cc index b5f992c..b6a24e7 100644 --- a/bindings/python/lg_python_wrap.cc +++ b/bindings/python/lg_python_wrap.cc @@ -3671,6 +3671,21 @@ void delete_lg_errinfo(lg_errinfo *lge) { free((void *)lge); } +/** + * incref/decref a Python object. + * Currently used on the Dictionary object when a Sentence object is created/deleted, + * because the Sentence object includes a reference to the Dictionary structure. + */ +void _py_incref(PyObject *x) +{ + Py_INCREF(x); +} + +void _py_decref(PyObject *x) +{ + Py_DECREF(x); +} + #ifdef __cplusplus extern "C" { #endif @@ -6174,6 +6189,36 @@ fail: } +SWIGINTERN PyObject *_wrap__py_incref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:_py_incref",&obj0)) SWIG_fail; + arg1 = obj0; + _py_incref(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap__py_decref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:_py_decref",&obj0)) SWIG_fail; + arg1 = obj0; + _py_decref(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + static PyMethodDef SwigMethods[] = { { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"lg_errinfo_severity_get", _wrap_lg_errinfo_severity_get, METH_VARARGS, NULL}, @@ -6275,6 +6320,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"_py_error_set_handler", _wrap__py_error_set_handler, METH_VARARGS, NULL}, { (char *)"_py_error_printall", _wrap__py_error_printall, METH_VARARGS, NULL}, { (char *)"delete_lg_errinfo", _wrap_delete_lg_errinfo, METH_VARARGS, NULL}, + { (char *)"_py_incref", _wrap__py_incref, METH_VARARGS, NULL}, + { (char *)"_py_decref", _wrap__py_decref, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; diff --git a/bindings/python/linkgrammar.py b/bindings/python/linkgrammar.py index 2bf5f57..c2a99cd 100644 --- a/bindings/python/linkgrammar.py +++ b/bindings/python/linkgrammar.py @@ -483,11 +483,13 @@ class Sentence(object): def __init__(self, text, lgdict, parse_options): # Keep all args passed into clg.* functions. self.text, self.dict, self.parse_options = text, lgdict, parse_options + clg._py_incref(self.dict) # The Sentence struct refers to the Dictionary struct self._obj = clg.sentence_create(self.text, self.dict._obj) def __del__(self): if hasattr(self, '_obj'): clg.sentence_delete(self._obj) + clg._py_decref(self.dict) del self._obj def split(self, parse_options=None): diff --git a/bindings/python3/__init__.py b/bindings/python3/__init__.py index d201c59..ed3e2d5 100644 --- a/bindings/python3/__init__.py +++ b/bindings/python3/__init__.py @@ -1,6 +1,6 @@ # # __init__.py file for Link Grammar Python bindings # -__version__ = "5.5.0" +__version__ = "5.5.1" from .linkgrammar import * diff --git a/bindings/python3/clinkgrammar.py b/bindings/python3/clinkgrammar.py index eb2438a..0fd4dcc 100644 --- a/bindings/python3/clinkgrammar.py +++ b/bindings/python3/clinkgrammar.py @@ -519,6 +519,14 @@ _py_error_printall = _clinkgrammar._py_error_printall def delete_lg_errinfo(lge: 'lg_errinfo') -> "void": return _clinkgrammar.delete_lg_errinfo(lge) delete_lg_errinfo = _clinkgrammar.delete_lg_errinfo + +def _py_incref(x: 'PyObject *') -> "void": + return _clinkgrammar._py_incref(x) +_py_incref = _clinkgrammar._py_incref + +def _py_decref(x: 'PyObject *') -> "void": + return _clinkgrammar._py_decref(x) +_py_decref = _clinkgrammar._py_decref # This file is compatible with both classic and new-style classes. diff --git a/bindings/python3/lg_python_wrap.cc b/bindings/python3/lg_python_wrap.cc index b5f992c..b6a24e7 100644 --- a/bindings/python3/lg_python_wrap.cc +++ b/bindings/python3/lg_python_wrap.cc @@ -3671,6 +3671,21 @@ void delete_lg_errinfo(lg_errinfo *lge) { free((void *)lge); } +/** + * incref/decref a Python object. + * Currently used on the Dictionary object when a Sentence object is created/deleted, + * because the Sentence object includes a reference to the Dictionary structure. + */ +void _py_incref(PyObject *x) +{ + Py_INCREF(x); +} + +void _py_decref(PyObject *x) +{ + Py_DECREF(x); +} + #ifdef __cplusplus extern "C" { #endif @@ -6174,6 +6189,36 @@ fail: } +SWIGINTERN PyObject *_wrap__py_incref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:_py_incref",&obj0)) SWIG_fail; + arg1 = obj0; + _py_incref(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap__py_decref(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + PyObject *arg1 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:_py_decref",&obj0)) SWIG_fail; + arg1 = obj0; + _py_decref(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + static PyMethodDef SwigMethods[] = { { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"lg_errinfo_severity_get", _wrap_lg_errinfo_severity_get, METH_VARARGS, NULL}, @@ -6275,6 +6320,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"_py_error_set_handler", _wrap__py_error_set_handler, METH_VARARGS, NULL}, { (char *)"_py_error_printall", _wrap__py_error_printall, METH_VARARGS, NULL}, { (char *)"delete_lg_errinfo", _wrap_delete_lg_errinfo, METH_VARARGS, NULL}, + { (char *)"_py_incref", _wrap__py_incref, METH_VARARGS, NULL}, + { (char *)"_py_decref", _wrap__py_decref, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; diff --git a/bindings/swig/link_grammar.i b/bindings/swig/link_grammar.i index 9edd479..15b1221 100644 --- a/bindings/swig/link_grammar.i +++ b/bindings/swig/link_grammar.i @@ -208,7 +208,7 @@ bool lg_error_flush(void); * void *lg_error_set_handler_data(void *); * A wrapper to this function is complex and is not implemented here. However, * such a wrapper may not be needed anyway since this function is provided - * mainly for the low-level implementation the error callback, so bound + * mainly for the low-level implementation of the error callback, so bound * languages can free the memory of the callback data. */ @@ -380,5 +380,20 @@ void delete_lg_errinfo(lg_errinfo *lge) { free((void *)lge->text); free((void *)lge); } + +/** + * incref/decref a Python object. + * Currently used on the Dictionary object when a Sentence object is created/deleted, + * because the Sentence object includes a reference to the Dictionary structure. + */ +void _py_incref(PyObject *x) +{ + Py_INCREF(x); +} + +void _py_decref(PyObject *x) +{ + Py_DECREF(x); +} %} #endif /* SWIGPYTHON */ diff --git a/configure b/configure index 46b58e3..cadb90e 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for link-grammar 5.5.0. +# Generated by GNU Autoconf 2.69 for link-grammar 5.5.1. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='link-grammar' PACKAGE_TARNAME='link-grammar' -PACKAGE_VERSION='5.5.0' -PACKAGE_STRING='link-grammar 5.5.0' +PACKAGE_VERSION='5.5.1' +PACKAGE_STRING='link-grammar 5.5.1' PACKAGE_BUGREPORT='link-grammar@googlegroups.com' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures link-grammar 5.5.0 to adapt to many kinds of systems. +\`configure' configures link-grammar 5.5.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1542,7 +1542,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of link-grammar 5.5.0:";; + short | recursive ) echo "Configuration of link-grammar 5.5.1:";; esac cat <<\_ACEOF @@ -1717,7 +1717,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -link-grammar configure 5.5.0 +link-grammar configure 5.5.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2398,7 +2398,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by link-grammar $as_me 5.5.0, which was +It was created by link-grammar $as_me 5.5.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2750,7 +2750,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu PACKAGE=link-grammar LINK_MAJOR_VERSION=5 LINK_MINOR_VERSION=5 -LINK_MICRO_VERSION=0 +LINK_MICRO_VERSION=1 MAJOR_VERSION_PLUS_MINOR_VERSION=`expr $LINK_MAJOR_VERSION + $LINK_MINOR_VERSION` VERSION=$LINK_MAJOR_VERSION.$LINK_MINOR_VERSION.$LINK_MICRO_VERSION # Version info for libraries = CURRENT:REVISION:AGE @@ -3276,7 +3276,7 @@ fi # Define the identity of the package. PACKAGE='link-grammar' - VERSION='5.5.0' + VERSION='5.5.1' cat >>confdefs.h <<_ACEOF @@ -17495,7 +17495,7 @@ CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3 -Wall" # The std=c11 flag provides the proper float-pt math decls working, -# e.g. fmaxf However, it also undefined _BSD_SOURCE, etc which is +# e.g. fmax However, it also undefined _BSD_SOURCE, etc. which is # needed to get fileno, strdup, etc. and so it needs to be manually # enabled again. @@ -19127,7 +19127,8 @@ if test "x$enable_java_bindings" = "xyes"; then CFLAGS="${CFLAGS} -arch x86_64" fi - JAVA_SRCDIR=../../bindings/java + absolute_srcdir=`(cd "$srcdir"; pwd)` + JAVA_SRCDIR=$absolute_srcdir/bindings/java if test "$native_win32" = yes; then # javac needs a Windows path JAVA_SRCDIR=`cygpath -w "$JAVA_SRCDIR"` @@ -21967,7 +21968,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by link-grammar $as_me 5.5.0, which was +This file was extended by link-grammar $as_me 5.5.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22024,7 +22025,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -link-grammar config.status 5.5.0 +link-grammar config.status 5.5.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 59d3cdf..cb6de05 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([link-grammar],[5.5.0],[link-grammar@googlegroups.com]) +AC_INIT([link-grammar],[5.5.1],[link-grammar@googlegroups.com]) dnl Set release number dnl This is derived from "Versioning" chapter of info libtool documentation. @@ -11,7 +11,7 @@ LINK_MINOR_VERSION=5 dnl 3) Increment when interfaces not changed at all, dnl only bug fixes or internal changes made. dnl 4b) Set to zero when adding, removing or changing interfaces. -LINK_MICRO_VERSION=0 +LINK_MICRO_VERSION=1 dnl dnl Set this too MAJOR_VERSION_PLUS_MINOR_VERSION=`expr $LINK_MAJOR_VERSION + $LINK_MINOR_VERSION` @@ -106,7 +106,7 @@ CFLAGS="${CFLAGS} -O3" CXXFLAGS="${CXXFLAGS} -O3 -Wall" # The std=c11 flag provides the proper float-pt math decls working, -# e.g. fmaxf However, it also undefined _BSD_SOURCE, etc which is +# e.g. fmax However, it also undefined _BSD_SOURCE, etc. which is # needed to get fileno, strdup, etc. and so it needs to be manually # enabled again. @@ -609,7 +609,8 @@ if test "x$enable_java_bindings" = "xyes"; then CFLAGS="${CFLAGS} -arch x86_64" fi - JAVA_SRCDIR=../../bindings/java + absolute_srcdir=`(cd "$srcdir"; pwd)` + JAVA_SRCDIR=$absolute_srcdir/bindings/java if test "$native_win32" = yes; then # javac needs a Windows path JAVA_SRCDIR=`cygpath -w "$JAVA_SRCDIR"` diff --git a/data/command-help-en.txt b/data/command-help-en.txt index a1d1c3c..eec617d 100644 --- a/data/command-help-en.txt +++ b/data/command-help-en.txt @@ -15,7 +15,7 @@ The displayed words are marked as follows: word.POS word found in the dictionary as word.POS word.#CORRECTION word is probably a typo - got linked as CORRECTION -For dictionaries that support morphology (turn on by !morphology=1): +For dictionaries that support morphology (enable with !morphology=1): word= A prefix morpheme =word A suffix morpheme word.= A stem @@ -24,25 +24,27 @@ For more details see: https://www.abisource.com/projects/link-grammar/dict/ [constituents] -Its value may be: - 0 Disabled +Accepted values are: + 0 Disabled (no constituent tree display) 1 Treebank-style constituent tree 2 Flat, bracketed tree [A like [B this B] A] 3 Flat, treebank-style tree (A like (B this)) [spell] -If zero, no spell and run-on corrections of unknown words are performed. -Else, use up to this many spell-guesses per unknown word. In that case, -the number of run-on corrections (word split) of unknown words is not -limited. +If zero, spell-guessing corrections and run-on corrections of unknown +words are not performed. Otherwise, this indicates the number of +spelling-correction guesses per unknown word. The number of run-on +corrections (word splits) of unknown words is not limited when +spell-guessing is enabled. [width] -When writing to a terminal, this value is set from its width. +The terminal width, used for wrapping the printing of long sentence +diagrams. [verbosity] -This is the level of description printed about the internal program working. -Values 1-4 are appropriate for use by the program user. -Higher values intended for LG dictionary writers and library developers. +The level of descriptive debug messages that will be printed. +Values 1-4 are appropriate for use by the program user. Higher +values are intended for LG dictionary authors and library developers. Some useful values: 0 No prompt, minimal library messages @@ -60,46 +62,55 @@ Also, when a word matches a RegEx, the matching dictionary entry is shown. [limit] -The maximum number of linkages that are considered in post-processing. If -more than this number of linkages found by the parser, then a random -sample of linkages is chosen. +The maximum number of linkages that are considered for post-processing. +Up to this many linkages are generated; if there are fewer parses than +thhis limit, then they will all be printed, in deterministic, +cost-ranked order. If there are more parses than this limit, then a +random subset will be printed. The !random option is used to control +whether this sampling will use a repeatable (deterministic) random +sequence, or not. [cost-max] -Determines the maximum disjunct cost used during parsing, where the cost -of a disjunct is equal to the maximum cost of all of its connectors. +Determines the largest disjunct cost considered during parsing. That is, +only disjuncts with a cost less than this are used during the parse; +higher-cost disjuncts are ignored. Raising the max allowed cost will +typically produce more parses, although these will less likely be +correct. [bad] -When True, display also linkages that fail post-processing, along with the -post-processing error that was found. +When True, display also linkages that are rejected by post-processing, +along with the name of the rule that resulted in the rejection. -This mode is useful for people editing the dictionary or post-processing. -The invalid linkages will be outputted after the valid ones. +This mode is useful when editing the dictionary or the post-processing +rule-set. The invalid linkages will be printed after the valid ones. -The parser will only output the linkages it finds at whatever stage it had -gotten to when it found a valid linkage. For example, if it had gotten to -null-link stage 2 before finding its first valid linkage, it will also output -invalid linkages found at null-link stage 2. There is no way of seeing invalid -linkages found at earlier stages. +The parser will only output the linkages it finds at whatever stage it +had gotten to when it found a valid linkage. For example, if it had +gotten to null-link stage 2 before finding its first valid linkage, +it will also output invalid linkages found at null-link stage 2. +There is no way of seeing invalid linkages found at earlier stages. [short] -Determines how long the links are allowed to be. The intended use of this -is to speed up parsing by not considering very long links for most -connectors, since they are rarely used in a correct parse. An entry for -UNLIMITED-CONNECTORS in the dictionary will specify which connectors -(according to the connector matching rules) are exempt from this length -limit. +Determines the maximum allowed length for certain connectors. The +intended use is to speed up parsing by not considering very long links +for most connectors, since they are rarely used in a correct parse. +Setting this too low will prevent valid parses; setting this too high +will slow the system, and occasionaly generate unlikely parses. +The limit applies only to those connectors not exempted by the +UNLIMITED-CONNECTORS dictionary entry. [timeout] Determines the approximate maximum time (in seconds) that parsing is -allowed to take. After this time has expired, the parsing process is -artificially forced to complete quickly by pretending that no further -solutions can be constructed. The actual parsing time might be slightly -longer. +allowed to take. If a parse is not found before this time, normal parsing +is halted, and a "panic parse" mode is entered. During the panic parse, +a looser, less restricitive set of parameters is used (primarily, a +larger !cost-max), in an effort to find some, any parse. Panic mode +can be enabled and disabled with the !panic option. For the SAT parser (see "!help use-sat") this option has no effect (yet). [memory] -The value of this variable has no effect for now. +The value of this variable has no effect at this time. [null] When False, only linkages with no null links are considered. @@ -107,19 +118,20 @@ When True, if the parser tries to find linkages with the minimal possible number of null links. [panic] -Use "panic-mode" if a parse cannot be found within the time set -by !timeout. In that mode, various parse options are adjusted so -a less accurate parse can be found quickly. +If enabled, then a "panic-mode" will be entered if a parse cannot be +found within the time limit set by !timeout. Wehn in panic mode, various +parse options are loosened so a less accurate parse can be found quickly. [use-sat] -Note: This parser cannot find yet linkages with null-links. -Also, the !timeout setup doesn't affect it. -It is supposed to be much faster than the standard parser on very long -sentences (that have a full parse - without null links). +Use the Boolean-SAT parser instead of the traditional parser. The SAT +parser can be much faster on long sentences, but is usually a little +bit slower for most "normal" sentences. + +This parser is not able to find linkages with null-links. It does not +honor the !timeout option. [walls] -The setup of this variable affects the display of the Graphics-mode -(see "!help graphics"). +Alters the display of parsed sentences (see "!help graphics"). When True, the RIGHT-WALL and LEFT_WALL are always displayed. When False, they are not displayed if their links are not considered "interesting" (by a hard-coded criterion in the LG library). @@ -140,14 +152,16 @@ Found 16 linkages (8 had no P.P. violations) at null count 1 LEFT-WALL this.d sentence.n is.v false.a this.d sentence.n is.v true.a [postscript] -For actual use, this postscript output needs a header that is printed when -!ps-header=True is set. -Note: The postscript output currently malfunctions for sentences longer +Generate postscript output. The generated postscript requires a header +in order to be properly displayed; the header is printed by setting +!ps-header=True. + +The postscript output currently malfunctions for sentences longer than a page width. [ps-header] -When True, print also an appropriate postscript header when -!postscript=True is set. +When set, and when !postscript=True is set, then the postscript header +will be printed. %[cluster] %This modes is not active for now (the source code may need fixes). @@ -159,54 +173,61 @@ When True, print also an appropriate postscript header when %The only allowed value is 1 for now (the source code may need fixes). [links] -When True, display complete link data, including post-processing domains. +When enabled, this will display each link, one per line, with the +words and connectors at each end of the link. The post-processing +domains are also displayed. + This mode is set to True when the standard input is not a terminal. [disjuncts] -When True, display the disjuncts that used for each word, including their -cost. +When True, display the disjuncts that used for each word, together +with their cost. [batch] -When True, the program process sentences in batch-mode, in which null-links -are not allowed (as if !null=False got issued). - -It is normally used with: -link-parser [dictionary name] [arguments] < input-file - -The user indicates in the input file which sentences should be rejected, and -which should be accepted; the parser then notifies the user when its judgments -differ. To say that the parser "rejects" a sentence means that it does not find -any linkages without null-links. - -To prepare a file for use in batch-mode, put "!batch" at the top of the file -in order to toggle it to True. -Then, for each sentence that should be rejected, precede the sentence with "*" -in the file. If it should be accepted, precede it with nothing. After -processing a batch file, the parser will then print the number of errors in the -file: i.e., the number of sentences on which its judgments differ with the -judgments indicated by the symbols. - -Our GitHub repository contains several large batch-files; For English, the -three most important ones are "corpus-basic.batch", "corpus-fixes.batch" and -"corpus-fix-long.batch". +When True, the program process sentences in batch-mode. During batch +mode, the usual parse printing is suppressed; only errors are reported. +In batch mode, a leading * in the first column can be used to indicate +a non-grammatical sentence. If such a sentence parses, an error is +printed. Conversely, an error is reported if no parses are found for +a a valid sentence. + +Batch testing is typically performed by piping a file to the parser; +for example + link-parser [dictionary name] [arguments] < input-file +or + cat input-file | link-parser [dictionary name] [arguments] + +This flag is then usually placed at the begining of the input-file +(other options may be specified, as well). Setting the !echo flag +can be useful, as it will echo the input sentence. + +Our GitHub repository contains several large batch-files used during +testing and development; for English, the three most important ones +are "corpus-basic.batch", "corpus-fixes.batch" and "corpus-fix-long.batch". See: https://github.com/opencog/link-grammar/tree/master/data/en For more details see BATCH-MODE in: https://www.abisource.com/projects/link-grammar/dict/introduction.html [echo] +Print the original input sentence. This is primarily useful when working +in !batch mode, which otherwise suppresses output. + This mode is set to True when the standard input is not a terminal. [rand] -Random numbers are used for sampling linkages if needed -(see "!help limit"). +If set to true, then a repeatable random sequence will be used, whenever +a random number is required. The parser almost never uses random +numbers; currently they are ony used in one place: to sample a subset +of linkages, if there are more parses than the linkage limit. +See "!help limit" for info on the linkage limit. [debug] This variable is for LG library development. Its purpose is to limit debug output, which may have a big volume otherwise, to certain functions or files. For example: -$ link-parser -verbosity=6 -debug=flatten_wordgraph,print.c + $ link-parser -verbosity=6 -debug=flatten_wordgraph,print.c will only show messages from the `flatten_wordgraph()` function or the print.c file. @@ -216,18 +237,19 @@ directory. [test] This variable is used to enable features that are for debug or have yet -no other variable to control them. -For example, this setting will show all the linkages without a need to -press RETURN after each one: +no other variable to control them. For example, to show all the +linkages without a need to press RETURN, use: -!test=auto-next-linkages + !test=auto-next-linkages For more details, see debug/README.md and link-grammar/README.md in our GitHub repository https://github.com/opencog/link-grammar . [file] -This command gets as an argument a file name to run in batch-mode. -See "!help batch". +Read text from this file. The file is assumed to contain sentences +and/or option settings. It is typically used for reading in batch-mode +files (see "!help batch") but can also be usefil in other scripting +situations. [variables] Variables can be set as follows: @@ -249,13 +271,13 @@ Its value may be: % FLAGS documentation: % These flags are defined in wordgraph.h. % Below, unsplit-word means a token before getting split. -% (*) marks the flags that are enabled for the default display. +% 1 and 2 mark the flags that are enabled in that modes. % % c Compact display -% d (*) Display debug labels -% h Display hex node numbers (for "dot" commands debug) -% l (*) Add a legend -% p Display back-pointing word-graph links -% s Display unsplit-words as subgraphs -% u (*) Display unsplit-word links +% d 1 Display debug labels +% h Display hex node numbers (for "dot" command debug) +% l 1,2 Add a legend +% p Display back-pointing links +% s 2 Display unsplit-words as subgraphs +% u 1 Display unsplit-word links % x Display using X11 even on Windows (if supported) diff --git a/data/demo-sql/Makefile.am b/data/demo-sql/Makefile.am index 3b10d92..2886274 100644 --- a/data/demo-sql/Makefile.am +++ b/data/demo-sql/Makefile.am @@ -6,9 +6,8 @@ DICTS= \ 4.0.knowledge \ 4.0.regex -# Do NOT install the demo at this time ... -# dictdir=$(pkgdatadir)/demo-sql -# dict_DATA = $(DICTS) +dictdir=$(pkgdatadir)/demo-sql +dict_DATA = $(DICTS) EXTRA_DIST = $(DICTS) \ corpus-basic.batch diff --git a/data/demo-sql/Makefile.in b/data/demo-sql/Makefile.in index bf533b7..cf87e81 100644 --- a/data/demo-sql/Makefile.in +++ b/data/demo-sql/Makefile.in @@ -13,6 +13,7 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -118,6 +119,35 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(dictdir)" +DATA = $(dict_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -314,10 +344,8 @@ DICTS = \ 4.0.knowledge \ 4.0.regex - -# Do NOT install the demo at this time ... -# dictdir=$(pkgdatadir)/demo-sql -# dict_DATA = $(DICTS) +dictdir = $(pkgdatadir)/demo-sql +dict_DATA = $(DICTS) EXTRA_DIST = $(DICTS) \ corpus-basic.batch @@ -359,6 +387,27 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs +install-dictDATA: $(dict_DATA) + @$(NORMAL_INSTALL) + @list='$(dict_DATA)'; test -n "$(dictdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(dictdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(dictdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dictdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(dictdir)" || exit $$?; \ + done + +uninstall-dictDATA: + @$(NORMAL_UNINSTALL) + @list='$(dict_DATA)'; test -n "$(dictdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(dictdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: @@ -398,8 +447,11 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile +all-am: Makefile $(DATA) installdirs: + for dir in "$(DESTDIR)$(dictdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -450,7 +502,7 @@ info: info-am info-am: -install-data-am: +install-data-am: install-dictDATA install-dvi: install-dvi-am @@ -494,21 +546,22 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-dictDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags-am uninstall uninstall-am + install install-am install-data install-data-am \ + install-dictDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-dictDATA .PRECIOUS: Makefile diff --git a/data/demo-sql/dict.db b/data/demo-sql/dict.db index 6dfe6b82bd04e654efbb9f2c5b302203291e8b28..eda81f959cbb30858bb7d91f77ed0c48f409aaaf 100644 GIT binary patch delta 1413 zcmcJO&rj1}7{~kac5A!A9@!Y(GNknYVHus6;l&^#135TZlpo_-wlZo)t8F*K!Hf{` z0MP*T07k=6O!Q!un0WKz0prP&2QOUw3ry6TZ?`Z4Ov6Fnyib2Tecw0F=lguSG_>>{ z^-bJNsg@$n>BfR=i3#cqg%C9)iWEihB-|tp22CF5jlT0dPsLrsE%1|aaRXEf4-YqJkno~4Ool_OVsaCY+6)`7U@~mts zm7VrB)J@7`omyK+cztUWyoB3u3Bus={qTMB?fELc9pBnvmDN(o#l}N^FCE~+S=k~p zuJveoQH%OLPA;eC$vnulada>owiMHH;vgGg?G2`*pP>N+S?-YyOU)LPXtSGc4YsPL zYQ{^d>35N>L2F($orvFYt^#fEGeS9z>1Z@MFg1RCJe?VrGU;0*gMWLw+(ai5iGiG& zwNzb`jYX-TXXS!2c)HXSqLazw;aX);Dk+9Zj*_(E!mMH(Ip_4BJdW;=rQj{>!9MK5 zV_1ePEWi`E2hUIHzKu85KijXpT-nQE9#v)bcyJiiwB@`wf@Do6jW$>p1|%~q4kAZQ zcXd@&Mpp|KP-^trq?EauO3{8CMMtH>JWilP*t%9tojA$W@`;*=$4F~93x_zH@Q}b1 zVGHiVPGg*}Wd;WjF_G7~6C#gOvcuDW#*JGEjk~&nu>1=Wy|-$IV{VE_Jm;EUa zDYw(KAh7j@WO6aGJu@AP5RVJ&(bmk&%nYZ;rY2%%iJ`-6gC>oR_ZQ7rH!*DF$me5# u(-%wqrM?*HSdf60DOiPa-Gy6!YS#C%W1|`->)5Cc$NZ1hoa{`KG58zEpN|&+ delta 671 zcmaKpL1+^}6ozN=&t^9xy2o`e@WNo)*(QYKW3ie`F zyaw(#(Z8WLK9d_lRirqMRj3a5}#ZE(u z;2XB_2Cwl1_u!%xN2hSOq%pl>EIOf>b$`n5-tnhPDt|GdSJJF(7@-@4GWO3*g>O$B zJ;_+1U^&i|(+j=DTkdoYtXM93ffv;8dO;~Au9m}&7s#mJma9d%X<5~5(#$%+PkhD) ztYe6;c!!-hdWM@BRA|zNCbOmPjk>R9VbE~{=>ssS<9EZ3+fx)2sKYdrsYD`CC9G5) z7HyoruuyBCZ8YeZHD{~CNhs8ha`yOfji6zLJNL3(S^ qGC!TMs5ZEo@lld4DA*+UgiYbZNWOmve*apwrbxej|0DbVQ}+N;Mx0Ur diff --git a/data/en/4.0.affix b/data/en/4.0.affix index d972c97..746e320 100644 --- a/data/en/4.0.affix +++ b/data/en/4.0.affix @@ -8,7 +8,7 @@ % Punctuation appearing on the right-side of words. ")" "}" "]" ">" """ » 〉 ) 〕 》 】 ] 』 」 "’’" "’" ” '' ' ` "%" "," ... "." 。 ‧ ":" ";" "?" "!" ‽ ؟ ? ! -_ ‐ ‑ ‒ – — ― … ━ – ー ‐ 、 +_ ‐ ‑ ‒ – — ― … ━ – ー ‐ 、= ~ ¢ ₵ ™ ℠ : RPUNC+; @@ -25,10 +25,9 @@ _ ‐ ‑ ‒ – — ― … ━ – ー ‐ 、 † †† ‡ § ¶ © ® ℗ № "#" * • ⁂ ❧ ☞ ◊ ※ ○ 。 ゜ ✿ ☆ * ◕ ● ∇ □ ◇ @ ◎ _ ‐ ‑ ‒ – — ― ~ – ━ ー -- - ‧ -w/ : LPUNC+; -% Split words that contain the following toekns in the middle of them. +% Split words that contain the following tokens in the middle of them. % We don't want comma's in this list; it tends to mess up numbers. e.g. % "The enzyme has a weight of 125,000 to 130,000" % We don't want colon's in this list, it tends to mess up time @@ -37,7 +36,7 @@ w/ % % TODO: this list should be expanded with other "typical"(?) junk % that is commonly (?) in broken texts. --- ‒ – — ― "(" ")" "[" "]" ... ";": MPUNC+; +-- ‒ – — ― "(" ")" "[" "]" ... ";" ±: MPUNC+; % Suffixes 's 're 've 'd 'll 'm ’s ’re ’ve ’d ’ll ’m: SUF+; diff --git a/data/en/4.0.dict b/data/en/4.0.dict index 19b7816..118e2e1 100644 --- a/data/en/4.0.dict +++ b/data/en/4.0.dict @@ -10,8 +10,8 @@ % % %***************************************************************************% -% Dictionary version number is 5.5.0 (formatted as V5v5v0+) -: V5v5v0+; +% Dictionary version number is 5.5.1 (formatted as V5v5v1+) +: V5v5v1+; : EN4us+; % _ORGANIZATION OF THE DICTIONARY_ @@ -127,11 +127,14 @@ nonCAP.zzz: ZZZ-; % e.g. "Got it from the Abbey of Stratford Langthorne" % links "of" to "Abbey" instead of "it". % +% (Js- & {Jk-}): Allows back-link to conjunction: +% e.g. "... to look at and listen to everything" +% % Ss*s+: blocks links to Ss*t- which accepts singular subject, but % requires plural object. See "are.v" for examples. % : - (Ss*s+ & ) or SIs- or (Js- & {Mf+}) or Os- + (Ss*s+ & ) or SIs- or (Js- & ({Jk-} or {Mf+})) or Os- or or ; @@ -248,7 +251,7 @@ nonCAP.zzz: ZZZ-; % "of" gets priority in modifying the and.j-n instead of "recommendations". % However, this cost then causes the following to parse incorrectly: % "...went to hell yesterday and heaven on Tuesday." -% Arghh... +% Arghh... only semantic disambiguation will work here. : ({@M+} & SJls+) or ({[@M+]} & SJrs-); : ({[@M+]0.4 or Mp+} & SJlp+) or ({[@M+]1.4 or [Mp+]} & SJrp-); : ({[@M+]0.4 or Mp+} & SJlu+) or ({[@M+]1.4 or [Mp+]} & SJru-); @@ -288,7 +291,8 @@ nonCAP.zzz: ZZZ-; % PFd+: prevent links to PFt- : [dWp- & (dPFb+ or dPFd+)]0.1; -% The use of COa here needs to be carefully re-examined; it is used much too freely. +% The use of COa here needs to be carefully re-examined; +% it is used much too freely. % COa+ is used to block links to COd- % Xc+ & Ic+: connect to imperatives (infinitive verbs): "Anyhow, don't" % Wc- & Xc+ & Qd+: subject-object inversion: "anyhow, am I right?" @@ -875,17 +879,20 @@ majority.n minority.n bunch.n batch.n bulk.n handful.n group.n: or ({Ds**c-} & ) or Us-)); -% This gets a cost, so that the {Jd-} link for measures.1 is preferred. +% []: costly, so that the {Jd-} link for measures.1 is preferred. kind_of: [] or EA+ or EE+ + or Em+ or Wa-; -% This gets a cost, so that the {Jd-} link for measures.1 is preferred. +% []: costly, so that the {Jd-} link for measures.1 is preferred. +% Em+: "she sort of hangs from his neck" type_of sort_of breed_of species_of: [] or [Us-] + or Em+ or [Wa-]; % This gets a cost, so that the {Jd-} link for measures.2 is preferred. @@ -1300,7 +1307,7 @@ she he: % The E- is for "It's either us or them" ... not ideal, but OK % See also me.p below. me him: - J- or Ox- or ({[[E-]]} & SJl+) or SJr-; + J- or Ox- or ({[[E-]]} & SJl+) or SJr- or Wa-; % DD+: "... how us two should work together" us: @@ -1369,8 +1376,7 @@ you: thou: Sp+ & ; -% Y'gotta, Y'gonna -Y' y' y'all: (Sp+ & ) or SIp-; +y'all: (Sp+ & ) or SIp-; % basilect you % Pg+: "yo leavin' already?" verb "are" is missing. @@ -1536,8 +1542,9 @@ half: {EN-} & % "How many years" -- prefer TQ+ over Dmc+ % OFd+ & Dmc+: "I drank many of the beers" +% Naked H+: "How many?" many: - (H- & ([[Dmc+]] or ND+ or NIn+ or TQ+)) + (H- & ([[Dmc+]] or ND+ or NIn+ or TQ+ or [[()]])) or (AM- & (Dmcy+ or Oy- or Jy-)) or ({EE-} & (ND+ or NIn+)) or ({DD-} & {EAx-} & Dmc+) @@ -1636,7 +1643,8 @@ such_an: Ds*kv+ or ( & Ds*kx+); % "all of the time". These are all temporal modifiers: use MVw ("when") % and use OFw to force linkage only to time exprs. -: MVw- & OFw+; +% OFw+ & Xc+ CO+: "Some of the time, I really hate it." +: (MVw- & OFw+) or (OFw+ & Xc+ & CO+); a_lot: [[]] @@ -1673,6 +1681,7 @@ a_few: % OFd+ & Dm+: "I ate some of the cookies"; cost to , so % that this comes first. % : "I saw him some of the time" +% {COw+} & : some: D+ or (OFd+ & Dm+ & {EC-}) @@ -1725,7 +1734,8 @@ all.e: or [[]]; % "he likes you least of all" has no determiner, just uses MVa-. -least.a: EA+; +% A+: "I shall retain every least word" +least.a: EA+ or [A+]; least.e: {DD-} & MVa- & {Mp+}; none: @@ -1883,12 +1893,14 @@ not_enough: or MVp- or Pp- or FM- or (Xc+ & Xd- & (MVx- or MX-)))); -and.j-ru: - (NIfn- & {NIr-} & NItn+ & (NM- or Jp- or - (NN+ or [[NF+]] or ({EN- or NIc-} & (ND+ or OD- or - ({{@L+} & DD-} & (Dmcn+ or ( & [])))))))) or +% MVa+: "survivors differ from comparisons (5 vs. 6, respectively)" +and.j-ru vs.j-ru vs..j-ru versus.j-ru v.j-ru v..j-ru: + (NIfn- & {NIr-} & NItn+ & (NM- or Jp- or EQ- or + (NN+ or [[NF+]] or ({EN- or NIc-} & (ND+ or OD- or + ({{@L+} & DD-} & (Dmcn+ or ( & []))))))) + & {{Xca+} & MVa+}) or (NIfu- & {NIr-} & NItu+ & - ((( & ( or Bsm+)) or (Us- & {Mp+})) or AN+ or Yd+ or Ya+)); + ((( & ( or Bsm+)) or (Us- & {Mp+})) or AN+ or Yd+ or Ya+)); % and.j-sum is used in numerical sums: "It's a hundred and two in the shade." % It's a hundred 'n two in the shade." @@ -2103,12 +2115,15 @@ thirty-first.ti .ti: TM-; % connector, although e.g. "point 1/2" would appear reasonable. Go through % these and add NM- analogously to other numbers as applicable. -twenties thirties, forties fifties sixties seventies eighties nineties +twenties thirties forties fifties sixties seventies eighties nineties hundreds.cnt: - {NA-} & {TA-} & DG- & (IN- or [[]]); + ({NA-} & {TA-} & DG- & (IN- or [[]])) or + ; % teens could be above or teenagers (words.n.2) -teens: ({TA-} & DG- & (IN- or )) or ; +teens: + ({TA-} & DG- & (IN- or )) or + ; hundred thousand half-thousand million half-million quarter-million billion half-billion quarter-billion trillion half-trillion @@ -2377,9 +2392,13 @@ per "/.per": Us+ & Mp-; : {@E-} & (Pg- or Mg-); % Pv- & OFj+: "knowledge was gained of the activities" -: {@E-} & ((Pv- & {hPFt-} & {} & {OFj+}) or Mv-) & ; -: {@E-} & ((Pv- & {hPFt-} & {} & {K+}) or Mv-) & ; -: {@E-} & ((Pv- & {hPFt-} & {}) or Mv-); +: + ({@E-} & ((Pv- & {hPFt-} & {} & {OFj+}) or Mv-) & ) + or ({EA-} & Wx-); +: + ({@E-} & ((Pv- & {hPFt-} & {} & {K+}) or Mv-) & ) + or ({EA-} & Wx-); +: {@E-} & ((Pv- & {hPFt-} & {}) or Mv- or ({EA-} & Wx-)); : or ; % used only in "as " constructions, which behave @@ -2455,8 +2474,7 @@ per "/.per": Us+ & Mp-; % : allows use of gerunds as nouns. : ( & - (Dmu- or [[()]]) & - (({[[Ds-]]} & OF+) or [[()]]) & + (Dmu- or ((Dmu- or [[Ds-]]) & OF+) or ()) & (( & {@MXs+} & ((Ss+ & ) or SIs- or Os- or J-)) or AJra- or AJla+ or @@ -2483,13 +2501,14 @@ per "/.per": Us+ & Mp-; % Qw- & : "Where are they?" -- verb must connect to wall. % Qe-: "How many times did you do it?" % Qd-: "Does he drink?" -- Qd connects directly to wall. +% {CO-} & Qd-: "By the way, does he drink?" % Iq-: "The big question is did he do it?" % Xd- & Iq-: "The big question is, did he do it?" : Rw- or ({{Xd-} & Iq-} & (Qd- or ((Qw- or Qe-) & ))) or [()]; % Just like above, but no aux, should always be anded with I+. % The idea here is that the verb on the other end of the I+ will % connect to the wall. -: Rw- or ({{Xd-} & Iq-} & (Qd- or Qw- or Qe-)) or [()]; +: Rw- or (({{Xd-} & Iq-} or {COw-}) & (Qd- or Qw- or Qe-)) or [()]; % These are the verb-form expressions for special verbs that can take % filler-"it" as a subject. @@ -2566,13 +2585,13 @@ per "/.per": Us+ & Mp-; : {@E-} & VJr-; : {@E-} & VJl+; : {@E-} & VJr*i-; -: ({@E-} & VJl*i+); +: {@E-} & VJl*i+; : {@E-} & VJr*t-; : {@E-} & VJl*t+; : {@E-} & VJrg-; : {@E-} & VJlg+; -: {@E-} & VJrh-; -: {@E-} & VJlh+; +: {@E-} & (VJrh- or MJrv-); +: {@E-} & (VJlh+ or MJlv+); : or @@ -2589,8 +2608,11 @@ per "/.per": Us+ & Mp-; % XXX TODO: do the above, as they show up... % % plural-or-infinitive macro; -% "Scientists sometimes may repeat experiments or use groups." +% "Scientists sometimes may repeat experiments or use groups." % Want "groups" to connect to "use", not "and". +% (($1) or [()]) & ): +% "they might supplement or replace anticoagulants" +% The first verb is expecting an object, but there isn't one. % Generic singular intransitive form @@ -2786,7 +2808,8 @@ have.v: or ((SIp+ or SFIp+) & (( & PP+) or CQ-)); %I've they've you've we've: PP+ & ; -’ve 've: Sp- & PP+; +’ve 've: + Sp- & & (PP+ or O+); has.v: @@ -2836,6 +2859,8 @@ hadn't.v-d hadn’t.v-d: or ({@E-} & (S- or SFs- or SFp- or (RS- & B-)))) & (PP+ or ((([[O+]] & ) or [[()]]) & )); +% ----------------------------------------------------------- +% "to be" % Give [K+] a cost so as to prefer Pp+ in general %: % ({@EBm+} & (((O*t+ or [B**t-] or [K+] or BI+ or OF+ or PF- or @@ -2849,6 +2874,10 @@ hadn't.v-d hadn’t.v-d: % ({N+} & (AF- or Pv+ or I*v+)) or % (({N+} or {Pp+}) & Pg*b+); +% But first, some wack idiomatic phrases that behave like "to be" +% Ix- & Pv+: "You may rest assured" +rest.w: Ix- & Pv+; + % no-obj is costly but allows "if it weren't for Sally" % [Cet+]: elided (silent "that"): "my guess is the door on the left hides the prize." % which really should be: "my guess is [that] the door on the left hides the prize." @@ -2875,12 +2904,13 @@ hadn't.v-d hadn’t.v-d: : ({@EBm+} & (( ([{CV-} & B**t-] + or (B**t- & ) or [K+] or ( & BI+) or ( & OF+) or (Osi+ & R+ & Bs+ & ) or (Opi+ & R+ & Bp+ & ) - or ([[()]] & )) & ) + or ([()]0.666 & )) & ) or ( & Pp+ & {THi+ or @MV+}) or THb+ or @@ -3145,6 +3175,7 @@ wouldn't wouldn’t: ( & {@E-} & (({RT+} & I+) or [[()]])) or ({@E-} & (({RT+} & I+) or [[()]]) & ); +% =================================================================== % EQUATIONS ETC. % % The below is just barely enough to parse just very simple equations @@ -3159,7 +3190,7 @@ wouldn't wouldn’t: % e.g. "( p < 0.01 )" for "( p is less than 0.01 )" % The parenthetical remarks must be offset by parenthesis, and % must link back to main clause with MV or MX. -=.v <.v >.v =<.v >=.v ==.v eq.v ne.v lt.v lte.v le.v gt.v gte.v ge.v +=.v <.v >.v =<.v >=.v ==.v ":.eq" eq.v ne.v lt.v lte.v le.v gt.v gte.v ge.v equiv.v sim.v simeq.v approx.v ~.v ~.v equals.eq is_less_than is_greater_than is_equal_to @@ -3180,13 +3211,16 @@ is_less_than_or_equal_to is_gretr_than_or_equal_to: % Binary operators, strict: % Here EQt attaches only to terms, which may be numbers or letters. % By contrast, EQrr can only attach to relations (=, < > etc.) -+.eq -.eq *.eq "/.eq" x.eqn plus.eq minus.eq times.eq divided_by: - (EQt+ & EQt- & (EQrr- or EQrr+ or AN+)) - or (EQt+ & Xc+ & EQt- & Xd- & (EQrr- or EQrr+ or AN+)) +% Negative cost is used to establish operator precedence; +% viz, these are lower cost than relations. ++.eq -.eq *.eq "/.eq" x.eqn plus.eq minus.eq times.eq divided_by +±.eq "+/-.eq": + (EQt+ & EQt- & ([EQrr- or EQrr+]0.1 or AN+ or NIfn+ or NItn-)) + or (EQt+ & Xc+ & EQt- & Xd- & ([EQrr- or EQrr+]0.1 or AN+ or NIfns+ or NItn-)) or (EQt- & Xd- & EQt+ & EQt- & Xc+) or (Xd- & EQt+ & EQt- & Xc+ & EQt+); -% turnstiles, implication, assignment +% turnstiles, entailment, implication, assignment ->.eq -->.eq "|-.eq" "|=.eq" ":-.eq" ":=.eq" <-.eq <--.eq : (S- & O+ ) & (AN+ or (Xd- & Xc+ & MX-)) & ; @@ -3194,6 +3228,9 @@ is_less_than_or_equal_to is_gretr_than_or_equal_to: =.eq <.e =<.e <=.e >.e >=.e +.e -.e <<.e >>.e x.e: EN+; +mean.eq avg.eq avg..eq average.eq sum.eq difference.eq total.eq: + EQt+; + % =================================================================== % COMMON VERB CATEGORIES (The last number of the file name indicates % the verb form: 1=plural-infinitive, 2=singular, 3=past("ed"), @@ -3245,7 +3282,7 @@ is_less_than_or_equal_to is_gretr_than_or_equal_to: (( & ({[[O+]]} & )) or ( & (({[[O+]]} & ) or ())) or - (({[[O+]]} & ) & )) + ((({[[O+]]} & ) or [()]) & )) or ; % accounts.v accrues.v aches.v acquiesces.v ad-libs.v adheres.v @@ -3300,7 +3337,7 @@ arisen.v: {@E-} & PP- & {@MV+} & ; /en/words/words.v.5.1: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words.v.5.2: (( & ()) or ( & ([] or ())) or @@ -3343,7 +3380,7 @@ come.v: (( & ()) or ( & (() or ())) or - (() & )) + ((() or [()]) & )) or (( & ()) or ( & ([] or ())) or @@ -3378,7 +3415,7 @@ coming.v: /en/words/words.v.2.1: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words.v.2.2: (( & ()) or ( & ([]0.2 or ())) or @@ -3443,7 +3480,7 @@ let.w sublet.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); let.w-d sublet.v-d: @@ -3487,7 +3524,7 @@ bid.v-d bade.v-d: judge.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); judges.v: (( & ()) or ( & ([]0.2 or ())) or @@ -3513,7 +3550,7 @@ judging.g: rise.v fall.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); rises.v falls.v: (( & ()) or ( & ([] or ())) or @@ -3556,6 +3593,7 @@ rising.v falling.v: % "What are the chances she will DRIVE him up to the farm?" % % No Pa links here: *they're building a skyscraper tall +% *ours works more elegant than yours % % [A+]0.5: He was xxx'ed there should have xxx as verb not adjective. % @@ -3569,13 +3607,16 @@ rising.v falling.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words.v.6.2: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); + +% : "Above him hung a lamp" +% However, not every verb listed would be used like that. /en/words/words.v.6.3: (( & ()) or @@ -3584,6 +3625,7 @@ rising.v falling.v: ) or ( & {K+} & ) or or + or ({K+} & ); split.v-d spread.v-d fit.v-d shut.v-d cast.v-d: @@ -3652,7 +3694,7 @@ frizz.v frizzle.v prink.v slough.v scuff.v tog.v swot.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); % Disambiguation: add a cost so that Bob the given name is preferred % to bob the verb: "Bob lives in China". @@ -3660,7 +3702,7 @@ bob.v: [ (( & ()) or ( & (() or ())) or - (() & )) ]0.2; + ((() or [()]) & )) ]0.2; % ------------------------------------------------------------ % just like & , except that "and" is the one @@ -3692,14 +3734,14 @@ catch.v drive.v strike.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); % special case: run-present-tense + run-beaten-driven run.v: (( & ()) or ( & (() or ())) or - (() & )) + ((() or [()]) & )) or (( & ()) or ( & ([] or ())) or @@ -3779,11 +3821,11 @@ running.g beating.g catching.g driving.g striking.g: /en/words/words.v.4.1 : (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words-medical.v.4.1: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words.v.4.2: (( & ()) or @@ -3805,6 +3847,7 @@ running.g beating.g catching.g driving.g striking.g: (() & ) or ) or ( & {{Xc+} & Pa+}) + or ( & Xc+ & Pa+) or or ; @@ -3871,7 +3914,7 @@ beset.v mistaken.v underwritten.v: frank.v : (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); % ----------------------------------------------------------------- % The simplest transitive, ditransitive constructions @@ -3885,7 +3928,7 @@ corral.v crown.v decant.v ink.v intone.v rope.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); corrals.v crowns.v decants.v inks.v intones.v ropes.v: (( & ()) or @@ -3917,7 +3960,7 @@ bake.v dictate.v kiss.v slice.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); bakes.v dictates.v kisses.v slices.v: (( & ()) or @@ -3958,7 +4001,7 @@ baking.g dictating.g kissing.g slicing.g: butter.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); butters.v: (( & ()) or ( & ([] or ())) or @@ -3995,7 +4038,7 @@ buttering.g: /en/words/words.v.8.1: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); /en/words/words.v.8.2: (( & ()) or ( & ([]0.2 or ())) or @@ -4059,7 +4102,7 @@ cut.v-d: raise.v lower.v up.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); raises.v lowers.v ups.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4084,7 +4127,7 @@ raising.g lowering.g upping.g: ( & ) or ; tend.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); tends.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4108,7 +4151,7 @@ consent.v endeavor.v hesitate.v proceed.v aspire.v purport.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); consents.v endeavors.v hesitates.v proceeds.v aspires.v purports.v: (( & ()) or @@ -4128,7 +4171,7 @@ consenting.v endeavoring.v hesitating.v proceeding.v aspiring.v purporting.v: endeavour.v condescend.v deign.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); endeavours.v condescends.v deigns.v: (( & ()) or ( & ([] or ())) or @@ -4140,17 +4183,17 @@ endeavoured.v-d condescended.v-d deigned.v-d: endeavouring.v condescending.v deigning.v: ( & ) or ; -: {@MV+} & { or THi+}; +: {@MV+} & { or THi+} & {VC+}; happen.v occur.v: - (( & ()) or - ( & (() or ())) or - (() & )); + (( & ()) or + ( & ([] or ())) or + (() & )); happens.v occurs.v: - (( & ()) or + (( & ()) or ( & ([] or ())) or (() & )); happened.v-d occured.v-d occurred.v-d: - (( & ()) or + (( & ()) or ( & ([] or ())) or (() & )); happening.v occuring.v occurring.v: ( & ) or ; @@ -4171,7 +4214,7 @@ happening.v occuring.v occurring.v: ( & ) or ; wish.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); wishes.v: (( & ()) or ( & ([] or ())) or @@ -4194,7 +4237,7 @@ hope.v agree.v pretend.v swear.v pray.v vow.v vote.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); hopes.v agrees.v pretends.v swears.v prays.v vows.v votes.v: (( & ()) or @@ -4292,7 +4335,7 @@ seeming.v: ( & ) or ; care.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); cares.v: (( & ()) or ( & ([] or ())) or @@ -4309,7 +4352,7 @@ conjecture.v allege.v surmise.v opine.v insinuate.v suppose.v: (( & ()) or ( & (() or ())) or - (() & )) or ; + ((() or [()]) & )) or ; asserts.v contends.v remarks.v retorts.v intimates.v exclaims.v conjectures.v alleges.v surmises.v opines.v insinuates.v supposes.v: @@ -4361,7 +4404,7 @@ theorize.v attest.v fantasize.v muse.v speculate.v concur.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); theorizes.v attests.v fantasizes.v muses.v speculates.v concurs.v: (( & ()) or @@ -4386,7 +4429,7 @@ testify.v comment.v respond.v hint.v reason.v brag.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); replies.v whispers.v argues.v sighs.v mutters.v testifies.v comments.v responds.v hints.v reasons.v brags.v: @@ -4420,7 +4463,7 @@ reasoning.v bragging.v: dream.v complain.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); dreams.v complains.v: (( & ()) or ( & ([] or ())) or @@ -4444,7 +4487,7 @@ dreaming.v complaining.v: & ; think.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); thinks.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4487,7 +4530,7 @@ mattering.v: ( & ) or ; suffice.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); suffices.v: (( & ()) or ( & ([] or ())) or @@ -4502,7 +4545,7 @@ sufficing.v: ( & ) or ; insist.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); insists.v: (( & ()) or ( & ([] or ())) or @@ -4517,7 +4560,7 @@ insisting.v: ( & ) or ; wonder.v inquire.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); wonders.v inquires.v: (( & ()) or ( & ([] or ())) or @@ -4539,7 +4582,7 @@ wondering.v inquiring.v: ( & ) or ; go.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); % SFs-: "There goes the cutest guy ever!", needs O*t to survive PP. % However, prefer Pg over O*t when possible... @@ -4584,7 +4627,7 @@ gonna.v: stay.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); stays.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4601,7 +4644,7 @@ staying.v: ( & ) or ; stand.v sit.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); stands.v sits.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4619,7 +4662,7 @@ standing.g sitting.g: ( & ) or or ; sound.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); sounds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4637,7 +4680,7 @@ sounding.v: ( & ) or ; act.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); acts.v: (( & ()) or ( & ([] or ())) or @@ -4656,7 +4699,7 @@ acting.v: ( & ) or ; reign.v rule.w: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); reigns.v rules.w: (( & ()) or ( & ([] or ())) or @@ -4668,6 +4711,8 @@ reigned.v-d ruled.w-d: reigning.v ruling.w: ( & ) or ; % O+ & K+: "She looked him over." +% O+ & MV+: "I'll look her in the eye" +% Must have at least one copy of MV+, to block "she looked him" % MVa+ connects to adverbs. % Pa+ connects to common adjectives (predicative adjectives) % K+ connects to particles. @@ -4675,11 +4720,12 @@ reigning.v ruling.w: ( & ) or ; % [K+]0.2: prefer Pa+ to K+ whenever possible: "She looked up" : {({@MV+} & (LI+ or [{Xc+} & Pa+]0.1)) or ({[K+]0.2 or AF-} & ) - or ((O+ & K+) & )}; + or (O+ & K+ & ) + or (O+ & MV+ & )}; look.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); looks.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4702,7 +4748,7 @@ looking.v: ( & ) or ; wave.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); waves.v: (( & ()) or ( & ([] or ())) or @@ -4717,7 +4763,7 @@ waving.v: ( & ) or ; repent.v disapprove.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); repents.v disapproves.v: (( & ()) or ( & ([] or ())) or @@ -4732,7 +4778,7 @@ repenting.v disapproving.v: ( & ) or ; talk.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); talks.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4749,7 +4795,7 @@ talking.v: ( & & ) or ; consist.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); consists.v: (( & ()) or ( & ([] or ())) or @@ -4764,7 +4810,7 @@ consisting.v: ( & ) or ; die.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); dies.v: (( & ()) or ( & ([] or ())) or @@ -4779,7 +4825,7 @@ dying.v: ( & ) or ; last.v wait.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); lasts.v waits.v: (( & ()) or ( & ([] or ())) or @@ -4800,7 +4846,7 @@ afford.v commit.v profess.v desire.v please.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); attempts.v undertakes.v manages.v plots.v prefers.v neglects.v affords.v commits.v professes.v: @@ -4877,7 +4923,7 @@ deserved.v-d desired.v-d pleased.v-d: seek.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); seeks.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4898,7 +4944,7 @@ decline.v fail.v hasten.v volunteer.v aim.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); declines.v fails.v hastens.v volunteers.v aims.v: @@ -4941,7 +4987,7 @@ declining.v failing.v hastening.v volunteering.v aiming.v: fight.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); fights.v: (( & ()) or ( & ([]0.2 or ())) or @@ -4964,7 +5010,7 @@ threaten.v mean.v arrange.v pledge.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); threatens.v means.v arranges.v pledges.v: (( & ()) or @@ -4990,11 +5036,11 @@ meaning.v arranging.v threatening.v pledging.v: : or - ({@MV+} & { or TH+ or Zs- or }); + ({@MV+} & { or TH+ or Zs- or or VC+}); plan.v confess.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); plans.v confesses.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5019,7 +5065,7 @@ planning.v confessing.v: & ; decide.v resolve.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); decides.v resolves.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5045,7 +5091,7 @@ deciding.g resolving.g: ( & ) or ; remember.v forget.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); remembers.v forgets.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5078,7 +5124,7 @@ remembering.v forgetting.v: & ; learn.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); learns.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5097,7 +5143,7 @@ learning.v: & ; propose.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); proposes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5115,43 +5161,51 @@ proposed.v-d: proposing.g: ( & ) or ; proposing.v: & ; -: or -({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); +: + + or (OF+ & ) + or ({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); demand.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); demands.v: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); -demanded.v-d: +demanded.v-d: + (( & ()) or ( & ([]0.2 or ())) or (() & ) or - ) or or -; + ) + or + or ; demanding.v: & ; demanding.g: ( & ) or ; -: {} or -({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); +: + {} + or (OF+ & ) + or ({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); beg.v plead.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); begs.v pleads.v: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); -begged.v-d pleaded.v-d: +begged.v-d pleaded.v-d: + (( & ()) or ( & ([]0.2 or ())) or (() & ) or - ) or or -; + ) + or + or ; begging.v pleading.v: & ; begging.g pleading.g: ( & ) or ; @@ -5188,7 +5242,7 @@ bearing.v: & ; love.v dislike.v hate.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); loves.v dislikes.v hates.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5216,7 +5270,7 @@ loving.v disliking.v hating.v: & ; begin.v continue.v cease.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); begins.v continues.v ceases.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5264,12 +5318,14 @@ beginning.v continuing.v ceasing.v: & ; start.v stop.v try.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); starts.v stops.v tries.v: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); + +% & Xc+ & Pa+: "he stopped, unable to continue" started.v-d stopped.v-d tried.v-d: (( & ()) or @@ -5277,6 +5333,7 @@ started.v-d stopped.v-d tried.v-d: (() & ) or ) or ( & {K+} & ) or + ( & Xc+ & Pa+) or ({K+} & ); starting.g stopping.g trying.g @@ -5296,7 +5353,7 @@ recollect.v adduce.v posit.v reiterate.v infer.v presuppose.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); recognizes.v disputes.v calculates.v records.v deduces.v accepts.v envisions.v recounts.v signifies.v clarifies.v discloses.v recollects.v adduces.v posits.v reiterates.v infers.v presupposes.v: @@ -5334,7 +5391,7 @@ undisputed.v: ( & {THi+}); repeat.v reflect.v provide.v counter.v signal.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); repeats.v reflects.v provides.v counters.v signals.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5378,7 +5435,7 @@ stipulate.v affirm.v certify.v trust.v postulate.v ensure.v imply.v verify.v boa (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); senses.v reaffirms.v doubts.v reckons.v regrets.v stipulates.v ascertains.v discerns.v affirms.v certifies.v trusts.v postulates.v ensures.v implies.v verifies.v boasts.v: @@ -5422,7 +5479,7 @@ proclaim.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); proclaims.v: (( & ()) or @@ -5455,7 +5512,7 @@ proclaiming.g: imagine.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); imagines.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5486,7 +5543,7 @@ emphasize.v maintain.v acknowledge.v note.v confirm.v stress.v assume.v: (( & ()) or ( & (() or ())) or - (() & )) or ; + ((() or [()]) & )) or ; declares.v fears.v concludes.v suspects.v concedes.v presumes.v foresees.v emphasizes.v maintains.v acknowledges.v notes.v @@ -5522,6 +5579,7 @@ foreseen.v: ( & {@MV+ or THi+}) or or ; + declaring.g fearing.g concluding.g suspecting.g conceding.g presuming.g foreseeing.g emphasizing.g maintaining.g acknowledging.g noting.g confirming.g stressing.g assuming.g: @@ -5531,12 +5589,14 @@ presuming.v foreseeing.v emphasizing.v maintaining.v acknowledging.v noting.v confirming.v stressing.v assuming.v: & ; +% --------------------------------------------------------------- + : {} or ({@MV+} & ( or TH+ or RSe+)); believe.v answer.v worry.v protest.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); believes.v answers.v worries.v protests.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5564,7 +5624,7 @@ believing.v answering.v worrying.v protesting.v: & ; rule.v add.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); rules.v adds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5590,7 +5650,7 @@ ruling.v adding.v: & ; figure.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); figures.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5610,23 +5670,24 @@ figuring.v: & ; % (QI+ & {MV+}): "I did not say why until recently" : - or ({@MV+} & ( or TH+ or RSe+ or Zs-)) + or ({@MV+} & ( or TH+ or RSe+ or Zs- or VC+)) or ({@MV+} & (QI+ & {MV+})); +% See also: words.v.10 for paraphrasing verbs % I- & B- & : "What did John say you should do?" predict.v realize.v discover.v determine.v announce.v say.v mention.v admit.v -recall.v reveal.v divulge.v state.v observe.v indicate.v +recall.v reveal.v divulge.v state.v observe.v indicate.v stammer.v bawl.v analyse.v analyze.v assess.v establish.v evaluate.v examine.v question.v test.v hypothesize.v hypothesise.v document.v envisage.v: (( & ()) or ( & (() or ())) or - (() & )) + ((() or [()]) & )) or (I- & & ); predicts.v realizes.v discovers.v determines.v announces.v says.v mentions.v admits.v recalls.v reveals.v divulges.v states.v observes.v -indicates.v +indicates.v stammers.v bawls.v analyses.v analyzes.v assesses.v establishes.v evaluates.v examines.v questions.v tests.v hypothesizes.v hypothesises.v envisages.v documents.v: @@ -5638,7 +5699,8 @@ documents.v: predicted.v-d realized.v-d discovered.v-d determined.v-d announced.v-d mentioned.v-d admitted.v-d recalled.v-d revealed.v-d divulged.v-d -stated.v-d observed.v-d indicated.v-d analysed.v-d analyzed.v-d +stated.v-d observed.v-d indicated.v-d stammered.v-d bawled.v-d +analysed.v-d analyzed.v-d assessed.v-d established.v-d evaluated.v-d examined.v-d questioned.v-d tested.v-d hypothesized.v-d hypothesised.v-d well-established.v-d envisaged.v-d documented.v-d: @@ -5664,13 +5726,13 @@ said.v-d: predicting.g realizing.g discovering.g determining.g announcing.g saying.g mentioning.g admitting.g recalling.g revealing.g -divulging.g stating.g observing.g indicating.g +divulging.g stating.g observing.g indicating.g stammering.g bawling.g analysing.g analyzing.g assessing.g establishing.g evaluating.g examining.g questioning.g testing.g hypothesizing.g hypothesising.g documenting.g envisaging.g: ( & ) or ; predicting.v realizing.v discovering.v determining.v announcing.v saying.v mentioning.v admitting.v recalling.v revealing.v -divulging.v stating.v observing.v indicating.v +divulging.v stating.v observing.v indicating.v stammering.v bawling.v analysing.v analyzing.v assessing.v establishing.v evaluating.v examining.v questioning.v testing.v hypothesizing.v hypothesising.v documenting.v envisaging.v: @@ -5684,7 +5746,7 @@ guess.v estimate.v understand.v notice.v explain.v esplain.v demonstrate.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); guesses.v estimates.v understands.v notices.v explains.v esplains.v demonstrates.v: @@ -5726,7 +5788,7 @@ demonstrating.v: & ; know.v: (( & ( & {dCPu-})) or ( & (( & {dCPu-}) or ())) or - (( & {dCPu-}) & )) or ; + ((( & {dCPu-}) or [()]) & )) or ; knows.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5755,7 +5817,7 @@ knowing.v: & ; request.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); requests.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5779,7 +5841,7 @@ requesting.v: & ; feel.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); feels.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5798,7 +5860,7 @@ feeling.v: & ; mind.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); minds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5816,7 +5878,7 @@ minding.v: & ; study.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); studies.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5839,7 +5901,7 @@ studying.v: & ; discuss.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); discusses.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5864,7 +5926,7 @@ justify.v risk.v avoid.v involve.v favor.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); opposes.v enjoys.v advocates.v contemplates.v entails.v necessitates.v justifies.v risks.v avoids.v involves.v favors.v: @@ -5898,7 +5960,7 @@ favoring.v: finish.v practice.v resist.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); finishes.v practices.v resists.v quits.v: (( & ()) or ( & ([]0.2 or ())) or @@ -5919,7 +5981,7 @@ quit.v-d: (( & ()) or ( & (() or ())) or - (() & )) or + ((() or [()]) & )) or (( & ( or ({Xc+} & Pa+))) or ( & ([ or ({Xc+} & Pa+)]0.2 or ())) or @@ -5951,7 +6013,7 @@ over_with: ; turn.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); turns.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6001,7 +6063,7 @@ becoming.v: & ; remain.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); remains.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6025,7 +6087,7 @@ remaining.v: & ; grow.v: (( & ()) or ( & (() or ())) or - (() & )) or ; + ((() or [()]) & )) or ; grows.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6052,7 +6114,7 @@ growing.v: & ; approve.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); approves.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6072,7 +6134,7 @@ approving.v: & ; dispose.v conceive.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); disposes.v conceives.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6096,13 +6158,13 @@ disposing.v conceiving.v: & ; speak.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); speaks.v: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); -spoke.v-d: +spoke.v-d spake.v-d: (( & ()) or ( & ([]0.2 or ())) or (() & ) or @@ -6118,7 +6180,8 @@ spoken.v: speaking.v: & ; speaking.g: ( & ) or or ; -% @MV+: "The coffee tastes (the same) as it did last year." (do not want O for "the same") +% @MV+: "The coffee tastes (the same) as it did last year." +% (do not want O for "the same") : or ({@MV+} & ((LI+ & ) or AF- or Pa+ or OF+)) @@ -6126,7 +6189,7 @@ speaking.g: ( & ) or or ; taste.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); tastes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6147,7 +6210,7 @@ tasting.v: & ; reek.v smell.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); reeks.v smells.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6266,7 +6329,7 @@ costing.g: ( & ) or ; find.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); finds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6277,7 +6340,7 @@ found.v-d: ( & ([]0.2 or ())) or (() & ) or ) or - ( & (({K+ or AF-} & ) or Pa+ or Pg+)) or + ( & (({K+ or AF-} & ) or Pa+ or Pg+)) or ({K+ or Pa+ or Pg+} & ); finding.v: & ; finding.g: ( & ) or ; @@ -6295,7 +6358,7 @@ finding.g: ( & ) or ; get.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); gets.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6335,7 +6398,7 @@ getting.g: ( & ) or ; leave.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); leaves.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6359,7 +6422,7 @@ leaving.g leavin'.g: ( & ) or ; keep.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); keeps.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6412,7 +6475,7 @@ free.i straight.i loose.i: Vs- & {MV+}; hold.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); holds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6437,7 +6500,7 @@ hostage.i captive.i: Vh- or Vth-; expect.v claim.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); expects.v claims.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6461,7 +6524,7 @@ expecting.v claiming.v: & ; intend.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); intends.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6494,7 +6557,7 @@ dare.v: (( & ()) or ( & (() or ())) or - (() & )) + ((() or [()]) & )) or ( & N+ & I+) or (SI+ & & I+); dares.v: @@ -6522,7 +6585,7 @@ daring.v: & ; like.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); likes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6546,7 +6609,7 @@ liking.v: & ; offer.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); offers.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6572,7 +6635,7 @@ offering.v: & ; refuse.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); refuses.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6599,7 +6662,7 @@ refusing.v: & ; want.v need.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); need.i need'st: {@E-} & ((S- & ) or (RS- & B-)) & (N+ & I+); wants.v needs.v: (( & ()) or @@ -6627,7 +6690,7 @@ wanting.v needing.v: & ; choose.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); chooses.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6658,7 +6721,7 @@ choosing.v: & ; prepare.v press.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); prepares.v presses.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6685,7 +6748,7 @@ preparing.v pressing.v: & ; require.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); requires.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6711,7 +6774,7 @@ requiring.v: & ; command.v order.v urge.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); commands.v orders.v urges.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6737,7 +6800,7 @@ commanding.v ordering.v urging.v: & ; consider.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); considers.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6762,7 +6825,7 @@ considering.v: & ; perceive.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); perceives.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6785,7 +6848,7 @@ perceiving.v: & ; report.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); reports.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6811,7 +6874,7 @@ reporting.v: & ; caution.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); cautions.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6837,7 +6900,7 @@ cautioning.v: & ; warn.v advise.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); warns.v advises.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6862,7 +6925,7 @@ warning.v advising.v: & ; hear.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); hears.v: (( & ()) or ( & ([]0.2 or ())) or @@ -6887,16 +6950,16 @@ hearing.v: & ; or ( & {TH+ or Zs- or QI+ or }) or ([[@MV+ & O*n+]]); -see.v: +see.v spot.v: (( & ()) or ( & (() or ())) or - (() & )); -sees.v: + ((() or [()]) & )); +sees.v spots.v: (( & ()) or ( & ([]0.2 or ())) or (() & ) or ); -saw.v-d: +saw.v-d spotted.v-d: (( & ()) or ( & ([]0.2 or ())) or (() & ) or @@ -6909,8 +6972,8 @@ seen.v: (() & )) or ( & {Pg+ or AZ+}) or ( & {Pg+ or AZ+} & ); -seeing.g: ( & ) or ; -seeing.v: & ; +seeing.g spotting.g: ( & ) or ; +seeing.v spotting.v: & ; % ditransitive verbs -- taking direct and indirect objects : @@ -6924,7 +6987,7 @@ assign.v rename.v repay.v dub.v entitle.v fine.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); owes.v delivers.v accords.v awards.v terms.v grants.v begrudges.v assigns.v renames.v repays.v dubs.v entitles.v fines.v: @@ -6968,7 +7031,7 @@ deliver.w: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); delivers.w: (( & ()) or @@ -7002,7 +7065,7 @@ give.v send.v bring.v lend.v issue.v hand.v pour.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); gives.v sends.v brings.v lends.v issues.v hands.v pours.v: @@ -7066,7 +7129,7 @@ lending.v issuing.v handing.v pouring.v: pass.v buy.v pay.v sell.v deal.v telegraph.v wire.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); passes.v buys.v pays.v sells.v deals.v telegraphs.v wires.v: (( & ()) or @@ -7112,7 +7175,7 @@ passing.v buying.v paying.v selling.v dealing.v telegraphing.v wiring.v: call.v shout.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); calls.v shouts.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7142,7 +7205,7 @@ calling.v shouting.v: & ; color.v colour.v paint.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); colors.v colours.v paints.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7183,7 +7246,7 @@ coloring.g colouring.g painting.g: write.v charge.v draw.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); writes.v reads.v charges.v draws.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7239,7 +7302,7 @@ writing.g reading.g charging.g drawing.g: sing.v dance.v cry.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); sings.v dances.v cries.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7274,7 +7337,7 @@ singing.v dancing.v crying.v: & ; allow.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); allows.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7299,7 +7362,7 @@ allowing.v: & ; promise.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); promises.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7330,7 +7393,7 @@ promising.v: & ; show.v: (( & ()) or ( & (() or ())) or - (() & )) or ; + ((() or [()]) & )) or ; shows.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7365,7 +7428,7 @@ showing.v: & ; teach.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); teaches.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7390,7 +7453,7 @@ teaching.v: & ; compel.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); compels.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7413,7 +7476,7 @@ compelling.g: ( & ) or ; force.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); forces.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7449,7 +7512,7 @@ implore.v motivate.v impel.v: (( & ()) or ( & (() or ())) or - (() & )) + ((() or [()]) & )) or ( & O+ & Xc+); designs.v permits.v pressures.v trains.v sentences.v causes.v @@ -7543,7 +7606,7 @@ using.g: ( & ( or MVs-)) or ; elect.v appoint.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); elects.v appoints.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7574,7 +7637,7 @@ electing.v appointing.v: & ; name.v designate.v label.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); names.v designates.v labels.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7597,7 +7660,7 @@ naming.v designating.v labelling.v labeling.v: & ; tag.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); tags.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7626,7 +7689,7 @@ tagging.v: & ; program.v oblige.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); programs.v obliges.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7650,7 +7713,7 @@ programing.v programming.v obliging.v: & ; convince.v persuade.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); convinces.v persuades.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7673,19 +7736,21 @@ convincing.v persuading.v: & ; % (QI+ & {MV+}): "I did not tell why until recently" % : "He told me that Fred is dead." % {O+} & : "He told me Fred is dead." +% [()]: "only he can tell" % : (((O+ & {O*n+ or K+}) or ) & & {TH+ or RSe+ or Zs- or or QI+ or BW-}) or ({O+ & } & ) or OF+ + or [()]0.3 or (QI+ & {MV+}) or ([[@MV+ & {O*n+} & ]]); tell.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); tell.w: {@E-} & I- & {@MV+} & (QI+ or TH+ or or RSe+ or Zs-) & ; tells.v: (( & ()) or @@ -7708,16 +7773,19 @@ telling.v: & ; % basilect telling tellin': & ; +% Many other paraphrasing question words are in words.v.10 % (QI+ & {MV+}): "I did not ask why until recently" +% OF+ & : "Joseph asked of her : Who is this ?" : ({(O+ & {O*n+}) or } & & {TS+ or or (QI+ & {MV+}) or BW-}) + or (OF+ & ) or ([[@MV+ & O*n+ & ]]); ask.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); asks.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7744,7 +7812,7 @@ asking.v: & ; help.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); helps.v: (( & ( or TH+)) or ( & ([ or TH+]0.2 or ())) or @@ -7768,7 +7836,7 @@ helping.v: & ; remind.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); reminds.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7792,7 +7860,7 @@ inform.v reassure.v alert.v guarantee.v notify.v forewarn.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); informs.v reassures.v alerts.v guarantees.v notifies.v forewarns.v: @@ -7826,7 +7894,7 @@ informing.v reassuring.v alerting.v guaranteeing.v notifying.v forewarning.v: assure.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); assures.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7877,7 +7945,7 @@ let's let’s: ({Ic-} & Wi- & {N+} & I+) or ({Ic-} & Wi- & N+); watch.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); watches.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7902,7 +7970,7 @@ watching.v: & ; appreciate.v spend.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); appreciates.v spends.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7937,7 +8005,7 @@ appreciating.v spending.v: & ; make.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); makes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7966,7 +8034,7 @@ making.v: & ; render.v deem.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); renders.v deems.v: (( & ()) or ( & ([]0.2 or ())) or @@ -7989,7 +8057,7 @@ deprive.v accuse.v acquit.v purge.v disabuse.v exonerate.v absolve.v rob.v convict.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); deprives.v accuses.v acquits.v purges.v disabuses.v exonerates.v absolves.v robs.v convicts.v: (( & ()) or @@ -8021,7 +8089,7 @@ exonerating.v absolving.v robbing.v convicting.v: & ; clear.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); clears.v: (( & ()) or ( & ([]0.2 or ())) or @@ -8167,7 +8235,7 @@ proving.v: & ; suggest.v anticipate.v recommend.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); suggests.v anticipates.v recommends.v: (( & ()) or ( & ([]0.2 or ())) or @@ -8195,7 +8263,7 @@ suggesting.v anticipating.v recommending.v: & ; deny.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); denies.v: (( & ()) or ( & ([]0.2 or ())) or @@ -8220,7 +8288,7 @@ denying.v: & ; describe.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); describes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -8245,7 +8313,7 @@ describing.v: & ; portray.v depict.v regard.v view.v characterize.v: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); portrays.v depicts.v regards.v views.v characterizes.v: (( & ()) or ( & ([]0.2 or ())) or @@ -8274,7 +8342,7 @@ take_over jump_ship see_fit take_note: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); does_so takes_place shows_up pleads_guilty pleads_innocent takes_office does_battle gives_way makes_way takes_part catches_up catches_on files_suit picks_up takes_off breaks_free takes_over @@ -8326,7 +8394,7 @@ come_true come_clean come_of_age: (( & ()) or ( & (() or ())) or - (() & )) or + ((() or [()]) & )) or (( & ()) or ( & ([] or ())) or @@ -8344,7 +8412,7 @@ allow_for bring_about get_rid_of let_go_of take_note_of: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); puts_up_with allows_for brings_about gets_rid_of lets_go_of takes_note_of: @@ -8376,7 +8444,7 @@ taking_note_of: take_it make_out point_out give_notice serve_notice: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); takes_it makes_out points_out gives_notice serves_notice: (( & ()) or ( & ([] or ())) or @@ -8420,7 +8488,7 @@ turning_out: & ; find_out figure_out: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); finds_out figures_out: (( & ()) or ( & ([] or ())) or @@ -8489,15 +8557,21 @@ ending_up: ( & ) or ; % wall connectors % The naked Wi+, without a WV+, links to imperatives: "put it on the table". % The naked Wn+, without a WV+, links to nominals: "what a shame!". +% The naked Wx+, without a WV+, links to opinions: "ruined!". % The naked Qd+, without a WV+, links to subj-verb-inverts: "are you % insane?", "Are you the one?" % XXX everywhere where Ws+ is used, should probably be !? -: hWa+ or hWi+ or hWn+ or hWw+ or hQd+; +: hWa+ or hWi+ or hWn+ or hWw+ or hWx+ or hQd+; : (hWd+ or hWp+ or hWr+ or hWq+ or hWs+ or hWj+ or hWc+ or hWe+ or hWt+ or hWo+) & ; % Paraphrasing, quotational complements: : [()]0.1; +% An entire quoted sentence. Costly, if the quotes are missing. +: + ((Xc+ or Xe+ or [()]) & QUd+ & ( or ) & {X+} & QUc+) + or [(Xc+ or Xe+) & ( or ) & {X+}]; + % Quote with or without quotation marks. % "This is a test," she said. % We should go, I agreed. @@ -8513,15 +8587,17 @@ ending_up: ( & ) or ; or ({@MV+} & ((Xd- or Xq-) & (Xc+ or Xp+ or ) & (COq+ or CP- or Eq+ or ))) or [{@MV+} & (Xc+ or Xe+ or [[()]]) & ] - or ({@MV+} & (Xc+ or Xe+ or [[()]]) - & QUd+ & ( or ) & {X+} & QUc+); + or ({@MV+} & ); % Xd- & Xc+: "If I'm right, he thought, this will work." % CPa- & Xc+: "So thinks everyone" +% CPa- & : "Spoke the king: Off with his head!" +% PF- & : "And thus spoke the king: Off with his head!" +% PF- (by itself): "And thus spoke the king" : {@MV+} & (((Xd- or Xq-) & (Xc+ or Xp+ or ) & (COq+ or CPx- or Eq+ or )) - or (CPa- & Xc+) + or ((PF- or CPa-) & { & {RW+}}) or [(Xc+ or Xe+) & ]); % filler-it: "The President is busy, it seems." @@ -8607,7 +8683,7 @@ asking.q: answer.w reply.w say.w vote.w: (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); answers.w replies.w says.w votes.w: (( & ()) or ( & ([] or ())) or @@ -8649,7 +8725,7 @@ double.v triple.v quadruple.v quintuple.v: {EN-} & (( & ()) or ( & (() or ())) or - (() & )); + ((() or [()]) & )); doubles.v triples.v quadruples.v quintuples.v: {EN-} & (( & ()) or @@ -8686,11 +8762,16 @@ doubling.g tripling.g quadrupling.g quintupling.g: % [Mp- & MVp-]-0.61 prefers a connection to both the noun and the % verb, helping disambiguate. The weight 0.61 plus 0.4 is greater % than one, to overcome cost on @MV+. +% +% The EA- & MX- needs to be tightened; it allows oddball constructions +% that prevent putting an EA+ on words.adv.2 (which should have EA+) : - or [Mp-]0.4 or Pp- or MVp- or [Mp- & MVp-]-0.61 - or [({Xc+ & {Xd-}} & CO+)] - or (Xd- & Xc+ & (MX*x- or MVx-)); + or [Mp-]0.4 or MVp- or [Mp- & MVp-]-0.61 + or ({EA-} & Pp-) + or (Xc+ & {Xd-} & COw+) + or [({Xc+ & {Xd-}} & (COa+ or COd+))] + or ({EA-} & Xd- & Xc+ & (MX*x- or MVx-)); % Wj- & Qd+: questions: By what means will you arrive? : @@ -8708,7 +8789,8 @@ doubling.g tripling.g quadrupling.g quintupling.g: : or [Mp-] or Pp- or MVa- or - [({Xc+ & {Xd-}} & CO+)] or + (Xc+ & {Xd-} & COw+) or + [({Xc+ & {Xd-}} & (COa+ or COd+))] or (Xd- & Xc+ & (MX*x- or MVx-)); under beneath: @@ -8729,7 +8811,7 @@ from: at toward towards without w/o.p: ({JQ+} & (J+ or Mgp+) & ) - or [MVp- & B-]; + or [MVp- & B-]; % % XXX FIXME: MVp- & J+ is wrong: "*I saw John except Fred" @@ -8806,11 +8888,13 @@ just_about nearly_about almost_about right_about: % EN- & Pp-: "you are half-way through" % EN- & J-: "He stopped, about half-way through" +% K-: "it wicks the moisture through" % right/straight through: right/straight needs to modify through, so % so that conjunctions can work correctly. through.r right_through straight_through: ({JQ+} & J+ & ( or FM-)) or (EN- & (Pp- or J-)) + or K- or [MVp- & B-]; : @@ -8916,7 +9000,7 @@ unlike: % XXX The Mp- below should be removed, and all occurrences of % Mp+ elsewhere should be replaced by (Mp+ or Mf+) % Mf- & MVp+: "She was a girl of about John's age" -of o': +of: ({JQ+} & (Js+ or Jp+ or Ju+ or Mgp+ or (QI+ & {CV+})) & (Mp- @@ -8953,7 +9037,7 @@ to.r: or [{Xd- & Xc+} & MVi-] or [] or [[R-]] )) - or (TO- & Xc+) + or ({NT-} & TO- & Xc+) or I*a+ or ({JQ+} & ([J+] or Mgp+) & ) or [MVp- & B-] @@ -8971,7 +9055,7 @@ care_of c/o: besides: {J+ or Mgp+} & ([({Xc+ & {Xd-}} & CO+)] or MVp- or ); throughout: {J+} & ([({Xc+ & {Xd-}} & CO+)] or MVp- or ); -versus v. vs. vs: (J+ & Mp-) or (G- & G+); +versus.r v..r v.r vs..r vs.r: (J+ & Mp-) or (G- & G+); worth.p: (Mp- & (J+ or OF+)) or (Paf- & Mgp+) or (Pa- & (J+ or B-)); opposite.p: J+ & ; @@ -9121,7 +9205,8 @@ somewhere someplace: or ({EL+} & (MVp- or Pp-)) or ({EL+} & {Xc+ & {Xd-}} & MVp+ & {Xc+ & {Xd-}} & COp+) or ({EL+} & {Xc+ & {Xd-}} & [[CO+]]) - or EE+; + or EE+ + or EA+; nowhere: {EL+} & (MVp- or Pp- or FM- or (Xc+ & Xd- & MVx-)); @@ -9190,7 +9275,7 @@ inside.r outside.r underneath alongside: or ({J+} & ( or FM-)); -amid plus.p minus.p via onto: +amid plus.p minus.p via onto on_to: J+ & ( or ); % Bare-naked MVp-: "I want it back" @@ -9244,6 +9329,7 @@ sideways ashore abreast aft half-way.r halfway.r two-fold downhill southward underfoot westward eastward northward overnight.r on_hold on_track in_situ in_toto off_balance +on_tiptoe in_check on_course off_course under_oath at_end by_example on_holiday by_invitation on_patrol on_stage in_step in_tempo on_schedule behind_schedule ahead_of_schedule for_good for_keeps @@ -9427,7 +9513,7 @@ ago: every.i: {EN-} & Ye+ & ; times.i x.i: - (ND- & (({Xc+ & {Xd-}} & CO+) or MVp- or EC+ or EZ+ or or Qe+)) or + (ND- & (({Xc+ & {Xd-}} & COa+) or MVp- or EC+ or EZ+ or or Qe+)) or (((({ND-} & DG-) & {}) or (ND- & Ys+)) & (({Xc+ & {Xd-}} & CO+) or MVp- or (Xd- & Xc+ & MVx-))); @@ -9578,6 +9664,10 @@ tenfold a_hundredfold a_thousandfold: {EN-} & (MVp- or Em+ or EC+ or [Pa-] or A+ % ====================================================================== % QUESTION WORDS +% Allow a question to be preceeded by a clause opener. +% "By the way, how was it?" +: {CO-} & Wq-; + % QI- & (): "I do not know who" % Ws- & Bsw+ & Sp*w+: "Who have bought your flat from?" % {EL+ & {N+}} & Wd-: "Who?" "Who else?" "Who else not?" @@ -9590,7 +9680,7 @@ who: or Jw- or ({EL+} & ((S**w+ & {Bsw+}) or (R+ & B*w+)) & {EW-} & (Ws- or Wq- or QI*d- or BIqd-)) or ({EL+ & {N+}} & Wd-) - or (Wq- & Qw+) + or ( & Qw+) or ({MVp+ or MVx+} & (S**w+ or (R+ & B*w+)) & (Xd- & (Xc+ or ) & MX*r-)); @@ -9607,7 +9697,7 @@ what: or Ss*w+ or Sp*w+ or (R+ & (Bsw+ or BW+))) - & {EW-} & (Wq- or Ws- or QI*d- or BIqd- or QJ+ or QJ-)) + & {CO-} & {EW-} & (Wq- or Ws- or QI*d- or BIqd- or QJ+ or QJ-)) or ({EL+} & Ww-) or (Wn- & O+) or ((Ss*d+ or (R+ & (Bsd+ or BW+))) @@ -9618,13 +9708,15 @@ what: or SJl+ or SJr- or (Xc+ & Ic+); -% QI- & (): "I do not know which" +% [QI-]: "I do not know which" +% (R+ & B*w+ & (QJ+ or QJ-)): "... which to pick and which to leave behind." which: ((Jr- or R-) & (({MVp+ or MVx+} & RS+) or )) or ((D**w+ or ({OF+} & (S**w+ or (R+ & B*w+)))) & {EW-} & (Wq- or Ws- or QI*d- or BIqd-)) or (JQ- & D+) or ({MVp+ or MVx+} & (S**w+ or B*w+) & ((Xc+ or ) & Xd- & MX*r-)) or [QI-] + or (R+ & B*w+ & (QJ+ or QJ-)) or Jw-; % or Wi-: "Which way, left or right?" @@ -9678,7 +9770,7 @@ whenever wherever however.c: whyever: ({EL+} & ( - (Ww- & Qw+) + ({CO-} & Ww- & Qw+) or (QI- & ( or )) or ( & ((SFsx+ & ) or WY- or BIq-)))) or [[{@CO-} & Wc- & Wi+]]; @@ -9694,7 +9786,7 @@ whichever: whence whither: {EL+} & (( & (({Xc+ & {Xd-}} & CO+) or ({Xd- & Xc+} & MVs-))) - or ({EW-} & Ww- & Qw+)); + or ({CO-} & {EW-} & Ww- & Qw+)); % Comparative-opener: "although a good worker, he's not a very good manager" : (O*c+ & {Xc+ & {Xd-}} & COc+); @@ -9723,7 +9815,7 @@ when: or MJl+ or ({JT-} & MJr- & Qw+) or ({EW-} & (QJ- or QJ+)) - or ({EW-} & Ww- & {Qw+}) + or ({CO-} & {EW-} & Ww- & {Qw+}) or (( or Mp+ or Mgp+ or Mv+) & (({Xd- & Xc+} & MVs-) or ({Xc+ & {Xd-}} & CO*s+) or (Xd- & Xc+ & E+))); @@ -9732,7 +9824,7 @@ when: % N+: "why not?" "Why the hell not?" why: {EL+} & ( - ({EW-} & (Ww- or Wq-) & {Qw+ or N+}) + ({CO-} & {EW-} & (Ww- or Wq-) & {Qw+ or N+}) or (QI- & ( or or [()])) or ( & ((SFsx+ & ) or WY- or BIq- or QJ+ or QJ-)) or COa+ @@ -9748,7 +9840,7 @@ why: where: {EL+} & ( - ({EW-} & Wq- & ((Rw+ & WR+) or (R+ & Bsw+) or Qw+)) + ({CO-} & {EW-} & Wq- & ((Rw+ & WR+) or (R+ & Bsw+) or Qw+)) or [QI-] or SJl+ or SJr- or ({EW-} & (QJ- or QJ+)) @@ -9768,12 +9860,12 @@ whether_or_not: % QI- & (): "I do not know how" % EL+: "How else would you say that?" -% (EAh+ or EEh+) & Ww-: "How big?" "How quickly?" +% (EAh+ or EEh+) & Wq-: "How big?" "How quickly?" how: ((((EAh+ or EEh+) & {HA+}) or H+ or AFh+) & {EW-} & (BIqd- or QI*d- or Wq- or Ws-)) - or ({EW-} & Ww- & [[()]]) - or ({EW-} & Wq- & (({EL+} & Qw+) or AF+)) + or [[{EW-} & Ww-]] + or ({EW-} & & (({EL+} & Qw+) or AF+)) or [QI-] or ({EW-} & (QJ- or QJ+)) or SJl+ or SJr- @@ -9840,7 +9932,9 @@ unless though.c even_though: as_if as_though: (( or Mgp+ or Mv+ or Mp+) - & (({Xc+ & {Xd-}} & CO*s+) or ({Xd- & Xc+} & MVs-) or (Xd- & Xc+ & E+))) + & (({Xc+ & {Xd-}} & CO*s+) or + ({Xd- & Xc+} & MVs-) or + (Xd- & Xc+ & E+))) or ((BIh- or LI-) & ); as_soon_as: @@ -9951,17 +10045,17 @@ and.j-g: [G- & G+]0.05; % AJ*s: superlative adjectives % and.j-a but.j-a yet.j-a and_yet: - ({Xd-} & AJla- & {EBb+} & AJr+) & (A+ or Pa- or [MVa-] or AJra-) & {}; + ({Xd-} & AJla- & {Xd-} & {EBb+} & AJr+) & (A+ or Pa- or [MVa-] or AJra-) & {}; % XJo-: either ... or ... or.j-a: - ({Xd-} & AJla- & {XJo-} & AJra+) & (A+ or Pa- or [MVa-] or AJra-); + ({Xd-} & AJla- & {Xd-} & {XJo-} & AJra+) & (A+ or Pa- or [MVa-] or AJra-); % XJn-: neither ... nor ... % Its marked optional only to solve the ugly case of % "he is in neither the 105th nor the 106th battalion" % At issue is that nouns really really want to get a determiner, so we give it one. -nor.j-a: AJ- & {XJn-} & AJ+ & (A+ or Pa- or [MVa-]); +nor.j-a: AJ- & {Xd-} & {XJn-} & AJ+ & (A+ or Pa- or [MVa-]); % comparatives: % he is bigger, and badder, than the pope. @@ -9986,25 +10080,33 @@ and.j-s: : [Ma-] or (Xd- & Xc+ & MX*a-); : Mp- or MVp- or (Xc+ & CO+); : J+ & ([Mp-] or Pp- or MVp-); +: Xd- & Mv-; % [Ma-]: it is more grammatically correct to have commas ... % {EBb+}: "blah but not blah", "blah and not blah" -but.j-m and.j-m: +% vs.: "We examined the setting (urban vs rural)" +but.j-m and.j-m vs.j-m vs..j-m versus.j-m v.j-m v..j-m: ({Xd-} & MJla- & {EBb+} & MJra+ & ) or ({Xd-} & MJlp- & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlj- & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & {EBb+} & MJrv+ & {Xc+} & ); % {XJo-}: Either .. or ... +% SJr+: "either by chemicals or hammering" as a stand-in for +% "by chemicals or by hammering" because the second "by" is a zero. +% "either by hammering or chemicals" or.j-m: ({Xd-} & MJla- & {XJo-} & {EBb+} & MJra+ & ) or - ({Xd-} & MJlp- & {XJo-} & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & {XJo-} & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlp- & {XJo-} & {EBb+} & (MJrp+ or SJr+) & ) or + ({Xd-} & MJlj- & {XJo-} & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & {XJo-} & {EBb+} & MJrv+ & {Xc+} & ); % XJn-: Neither .. nor ... nor.j-m: ({Xd-} & MJla- & XJn- & {EBb+} & MJra+ & ) or ({Xd-} & MJlp- & XJn- & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & XJn- & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlj- & XJn- & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & XJn- & {EBb+} & MJrv+ & {Xc+} & ); % Conjoined question words. % When and where is the party? @@ -10165,17 +10267,24 @@ then.j-c: {Xd-} & XJc- & VJr+; % XXX This is hacky, we should just prevent such infinitive links from % occurring at all. % {TO+}: "I aim to do something and to help." +% {N+} & {TO+}: "I aim to do something and not to complain." +% {N+}: "John wants to pay for the beer, not steal it." +% Jj- & Jk+: "... to look at and listen to everything." +% This is a link-crossing hack; see the link-crossing +% discussion in the README; see section-J.html in the docs. : (({Xd-} & VJlsi- & VJrsi+) & (({@MV+} & Ss- & ) or (RS- & Bs-) or ([I-]0.2 & {@MV+} & ) or ({Xd-} & VJrsi-))) or - (({Xd-} & VJlpi- & {TO+} & VJrpi+) & + (({Xd-} & VJlpi- & {N+} & {TO+} & VJrpi+) & (({@MV+} & Sp- & ) or (RS- & Bp-) or ([I-]0.2 & {@MV+} & ) or ({Xd-} & VJrpi-))) or + (({Xd-} & Jj- & VJlpi- & VJrpi+ & Jk+) & + ([I-]0.2 & {@MV+} & )) or (({Xd-} & VJlst- & VJrst+) & ((({@MV+} & Ss- & ) or ([I-]0.2 & {@MV+} & )) & @@ -10281,13 +10390,16 @@ thus therefore therefor: % it tastes bitter, not sweet % "not" is modifying comma % it tastes bitter and not sweet % EB- & EE+: "but not very much" -% optional {EA+} to make "he is not a good programmer" -% FIXME: it would be nice to have some + link for this case, also. +% {EA+}: "he is not a good programmer" +% FIXME: it would be nice to have some + link for this case, also. +% N- & En+: "he does not want to steal it" not.e: - (EBm- & {EA+ or EE+}) + [EBm-]0.1 + or (EBm- & (EA+ or EE+)) or (EBb- & {EA+}) or (EBx- & {EA+}) - or ({@E-} & N-) + or ({@E-} & N- & En+) + or [{@E-} & N-] or NT+ or EBy+ or @@ -10326,11 +10438,12 @@ just_not: ; % % Lots and lots, but not all ordinary adjs can take : % Pa- & : "... is too abrasive to talk to." +% {Xd-} & Pa-: "she stood there, naked" % [EAh- & {Qe+}]: "How big?" "How tall?" -- large cost, as it otherwise % causes bizarre parses for "a decidedly jolly good player" : ({EA- or EF+} & ( - ((Pa- or AF+ or Ma- or MJra-) & {@MV+} & {}) + ({Xd-} & (Pa- or AF+ or Ma- or MJra-) & {@MV+} & {}) or ({@MV+} & MJla+) or AA+ or )) @@ -10405,12 +10518,14 @@ tawny.a ultramarine.a umber.a yellow.a: ; +% Wx-: single-word opinion expression : or ({EA- or EF+} & ( ((AF+ or Ma- or MJra-) & {@MV+}) or ({@MV+} & MJla+) or AA+ or + Wx- or [[DD- & ]] or [[{DD-} & ]])); @@ -10985,8 +11100,10 @@ as.e-c: % Cz+ & CV+: "the accused, as it shall be shown, is innocent" % use Cz instead of because post-processing kills the % Cs link with a "Unbounded s domain78" error. +% {EZ-} & Cz+ & CV+: "Just as I suspected!" +% cost on EZ-: prefer just.e over just.a +% % AZ- & Mg+: "It described the treaty as marking a new stage" -% & CO+: "As we set sail, a gale blew up" % BIt+: "his statements, as candidate, contradict his actions" as.e: ((J+ or Mp+ or TI+ or Zs+) & @@ -10994,23 +11111,64 @@ as.e: or ((J+ or Mp+ or BIt+) & ([Mp-] or (Xd- & Xc+ & MX*x-))) or (AZ- & Pa+) or (AZ- & Mg+) - or ({Xd-} & {[hVCz-]-0.05} & Cz+ & CV+) + or (({[EZ-]-0.5} or {Xd-}) & {[hVCz-]-0.05} & Cz+ & CV+) % or ({Xd-} & hVCz- & Cz+ & CV+) - or ( & (({Xc+ & {Xd-}} & CO+))) or ((Sa*v+ or (Sa*a+ & CV+)) & {Xc+ & {Xd-}} & CO+) or (Sa*v+ & {Xd- & {Xc+}} & VCz-) or [Sa*a+ & CV+ & {Xd- & {Xc+}} & VCz-]-0.05 or (Sa*a+ & CV+ & {Xd- & {Xc+}}) % needed for MXsr constructions - or (MVi- & TO+) + or (MVi- & TO+ & IV+) or [[(PFc+ or CQ+) & ({Xd- & Xc+} & MVs-)]]; +% "as" as synonym for "while" +% & CO+: "As we set sail, a gale blew up" +% MVs- & Cs+ & CV+: "I slipped as I ran" +as.#while: + ( & (({Xc+ & {Xd-}} & CO+))) + or (MVs- & Cs+ & CV+); + + as_is: {Xd- & Xc+} & MVs-; as_possible: MVz-; +% "It is just like I suspected." +like.e: + ({EZ-} or {Xd-}) & {[hVCz-]-0.05} & Cz+ & CV+; + +% Em+: "That is so not going to happen" +% EExk+: "That is so very beautiful" +% EBb- & EAxk+: "It tastes bitter and so good" +% MVp- & Xc+: "Hold the brush so" +% Pv-: "It seems so" +% MVs-: "she insisted, so we will do it" +% Cz+ & CV+: "the accused, so it shall be shown, is innocent" +so.e: + ({EBb-} & EAxk+ & {HA+}) + or ({EZ-} & EExk+) + or Em+ + or + or (Wq- & CQ+) + or Wa- + or (MVp- & Xc+) + or ({Xd-} & {[hVCz-]-0.05} & Cz+ & CV+) + or Pv- + or O- + or Js-; + +and_so and_thus: + ; + +% Is ever needed here? +% Should we be using instead of MVs- ?? +% Or maybe every use of MVs- should be converted to ??? +so_that such_that: + & {Xd- & Xc+} & MVs-; + % Cc+ & CV+: C links to the head-noun of the following clause, and CV+ % links to the head verb. Must form a cycle. % Example: "I run more often than Ben climbs" +% MVp- & J+: "... other traditions than my own" than.e: (MVt- & (((O*c+ or ({SFsic+} & Zc+) or U*c+) & {Mp+}) or Mpc+ or S**c+ or MVat+ or MVpt+ or (Cc+ & CV+) or Pafc+)) @@ -11018,18 +11176,21 @@ than.e: or ((MVti- or LEi-) & AFdi+ & {Pa+}) or (((LE- & {AFd+}) or (LEi- & {AFdi+})) & (THc+ or (TOic+ & ) or (TOfc+ & ) or (TOtc+ & B+))) - or (((MVto- & Ct+ & Bc+ & {U+}) or (MVtp- & (CX+ or CQ+))) & {Mp+}); + or (((MVto- & Ct+ & Bc+ & {U+}) or (MVtp- & (CX+ or CQ+))) & {Mp+}) + or (MVp- & J+); % cost on MVa-: "we will arrive much sooner", want "much" to modify "sooner". % ({OFd+} & Dmu+): "I drank much of the beer" % cost on [[]] so that the above is preferred to an O- link +% EZ+: "Much as I expected!" much: ({EE-} & ([[MVa-]] or ( & ECa+) or or Qe+)) or ({EEx- or H-} & ( ECn+ or ({OFd+} & Dmu+) or ( & ([[]] or Bsm+)))) - or (AM- & (Dmuy+ or MVy- or Oy- or Jy- or EB*y-)); + or (AM- & (Dmuy+ or MVy- or Oy- or Jy- or EB*y-)) + or EZ+; slightly somewhat: EC+ or EA+ or MVa- or Em+; far.c infinitely: EC+; @@ -11130,7 +11291,10 @@ than_intended than_supposed than_reported than_ever than_usual than_normal than_suggested than_anticipated than_recommended: MVt-; more_than no_more_than fewer_than less_than as_many_as an_estimated -an_additional up_to as_much_as no_fewer_than no_less_than greater_than: EN+; +an_additional up_to as_much_as no_fewer_than no_less_than greater_than +upwards_of: + EN+; + at_least: EN+ or CO+ or [[{Xd- & Xc+} & MVa-]] or EB-; % This is not quite right, since there may be other words in between @@ -11258,13 +11422,15 @@ notoriously.e: % "It's an inherently better method" thus EC+ link fabulously marginally moderately relatively ridiculously: - or ({EE- or } & EC+) - or ({EE-} & EBm-); + or ({EE-} & EBm- & EC+) + or [{EE- or } & EC+] + or [{EE-} & EBm-]; incomparably inherently unacceptably unarguably undeniably unimaginably: - or ({EE- or } & EC+) - or ({EE-} & EBm-); + or ({EE-} & EBm- & EC+) + or [{EE- or } & EC+] + or [{EE-} & EBm-]; wide.e: & EE+; @@ -11288,7 +11454,8 @@ quite: amazingly incredibly: - or EBm- + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or ({Xd- & Xc+} & Em+) or ({Xc+ & {Xd-}} & CO+) or (Xd- & Xc+ & MVa-); @@ -11296,7 +11463,8 @@ amazingly incredibly: % MVa-: "He is behaving very strangely" strangely: - or EBm- + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or ({Xd- & Xc+} & Em+) or ({Xc+ & {Xd-}} & CO+) or ({Xd- & Xc+} & {EE-} & MVa-); @@ -11310,30 +11478,42 @@ rather: particularly: - or Em+ or EB- + or Em+ + or [EB- & (EC+ or EA+)]-0.5 + or [EB-] or (MVl- & (MVp+ or MVa+ or MVs+)) or ({Xc+ & {Xd-}} & CO+); notably: - or EB- or ({Xc+ & {Xd-}} & CO+); + or [EB- & (EC+ or EA+)]-0.5 + or [EB-] + or ({Xc+ & {Xd-}} & CO+); % Mp- & Ju+: "She was a girl nearly John's age" % MVp- & Ju+: "She was a girl of nearly John's age" +% [EBm- & EA+]-0.1: proiritize above naked EA+ +% almost: - or EN+ or EZ+ or Em+ or EBm- + or EN+ or EZ+ or Em+ + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or (MVl- & (MVp+ or MVa+ or MVs+)) or ((Mp- or MVp-) & Ju+); nearly: - - or EN+ or EZ+ or Em+ or EBm- + + or EN+ or EZ+ or Em+ + or [EBm-] + or [{EE-} & EBm- & (EC+ or EA+)]-0.5 or (MVl- & (MVp+ or MVa+ or MVs+)) or ((Mp- or MVp-) & Ju+); % The below is similar to "nearly" ... -just_about: Em+ or EN+ or EZ+ or EA+; +just_about: + Em+ or EN+ or EZ+ + or EA+; entirely: @@ -11387,6 +11567,7 @@ partly.e largely.e mostly.e chiefly.e simply.e purely.e solely.e: % Em+: "It sure is great" sure.ee: Em+; +very_much: Em+; % Em+: "It sure the fuck is great to see you, man!" % "It sure the hell is!" @@ -11651,7 +11832,8 @@ certainly possibly probably importantly remarkably interestingly: % absurdly actually additionally admittedly allegedly alternatively /en/words/words.adv.2: E+ - or (Xd- & Xc+ & (E+ or MVa-)) + or (Xd- & Xc+ & E+) + or ({Xd- & Xc+} & MVa-) or ({Xc+ & {Xd-}} & CO+) or EBm-; @@ -11779,7 +11961,7 @@ tsk tsk_tsk tsk_tsk_tsk: % as adjectives, as well. % A- & Wa-: "Holy Mother of God" howdy phew psst pssst ahem -ah ahh eh ehh hmm hmmm huh +ah ahh a_ha aha eh ehh hmm hmmm huh oops eep egad egads ermahgerd ouch alas whoa whoah oh.ij ohh doh dohh woo_hoo boo.ij booo boooo phooey pooh @@ -11879,6 +12061,7 @@ seldom rarely.e: ({EE-} & (E+ or EB-)) or ; % MVl- & MVl+: " we are going to arrive just about on time" just.e: E+ + or (EB- & EA+) or [EB-] or EC+ or EN+ @@ -11983,6 +12166,13 @@ so_on the_like vice_versa v.v.: : ( or ) & {hCPx+ or hCPi+ or hCPu+} & {(Xx+ or Xp+ or Xs+) & {hWV+}} & {RW+ or Xp+}; +% : "So, don't do it!" +% The cost on sent-start is to force preference for CV over WV, +% whenever possible. +so.ij: + (({Xd-} & ([MVs-]0.5 or ) & Xs-) or ({Xc+} & Wc-)) + & ( or []0.5); + % QU+ links to quoted phrases. % ZZZ+ is a "temporary" addition for randomly-quoted crap, and % virtual CAPs morphemes. (??) @@ -12000,39 +12190,6 @@ RIGHT-WALL: RW- or ({@Xca-} & [[Xc-]]); % mid-text period, question mark. Splits into two sentences. : Xp- & ; -% In many ways, "so" acts as a synonym for a semicolon... -% : "So, don't do it!" -% The cost on sent-start is to force preference for CV over WV, -% whenever possible. -% Em+: "That is so not going to happen" -% EExk+: "That is so very beautiful" -% EBb- & EAxk+: "It tastes bitter and so good" -% MVp- & Xc+: "Hold the brush so" -% Pv-: "It seems so" -% MVs-: "she insisted, so we will do it" -so: - ({EBb-} & EAxk+ & {HA+}) - or ({EZ-} & EExk+) - or Em+ - or ((({Xd-} & ([MVs-]0.5 or ) & Xs-) or ({Xc+} & Wc-)) - & ( or []0.5)) - or - or (Wq- & CQ+) - or Wa- - or (MVp- & Xc+) - or Pv- - or O- - or Js-; - -and_so and_thus: - ; - -% Is ever needed here? -% Should we be using instead of MVs- ?? -% Or maybe every use of MVs- should be converted to ??? -so_that such_that: - & {Xd- & Xc+} & MVs-; - % Quotation marks. % TODO: Add ' as quotation mark. % For a list see: @@ -12052,7 +12209,7 @@ so_that such_that: % For now, using ".x and ".y in the above definitions multiplies the number % of linkages by 2^(number of "). So it is separated below. -% [[ZZZ-]]: link to "random" quotion marks that show up "for no reason". +% [[ZZZ-]]: link to "random" quotation marks that show up "for no reason". % Cannot use a blanket W+ here to pick up all W connectors, because ... ?? """: QUd- or or [[ZZZ-]]; @@ -12109,12 +12266,16 @@ so_that such_that: % cost on []: allow Pa links with commas, e.g. % "he paced, worried" but lower cost than Xx links % +% SJl- & J- & SJr+: "by the A, the B..." +% This is a tiny part of and.j-n, but we do not want the full +% complexity of and.j-n here, since the commas force this. ",": ({[@Xca-]-0.05 or [[[@Xc-]]]} & (({[EBx+]} & Xd+) or Xc-)) or [] or or or []0.5 + or (SJl- & J- & SJr+) or (SJl- & SJr+ & SJl+); % :.j @@ -12288,6 +12449,54 @@ thru.#through-r: [through.r]0.05; nite.#night: [night.r or night.u or night.i or night.n]0.05; tonite.#tonight: [tonight]0.05; +% Y'gotta, Y'gonna +% "keep y'mouth shut" +y'.#you: [you]0.05; +y'.#your: [your]0.05; + +o'.#of: [of]0.05; + +e.#he: [he]0.05; + +be.#by: [by]0.05; +de.#the: [the]0.05; + +drinkin.#drinking-v: [drinking.v]0.05; +drinkin'.#drinking-v: [drinking.v]0.05; +runnin'.#running-v: [running.v]0.05; +kidnappin'.#kidnapping-v: [kidnapping.v]0.05; + +an'.#and-j-n: [and.j-n]0.05; +an'.#and-j-v: [and.j-v]0.05; + +% A bit too loose. These should only become enabled if the context +% is correct. +% an.#and-j-n: [and.j-n]; +% an.#and-j-v: [and.j-v]; + +% Bad German accent +vas.#was-v-d: [was.v-d]0.05; +vas.#what: [what]0.05; +das.#this-p: [this.p]0.05; +das.#this-d: [this.d]0.05; + +% Colloquial usages of "as": +% "I don't know as I can answer your question." +as.#that: [that.j-c]0.05; + +% Desirable multi-word substitutions: +% as.#same-as: [the_same_as]0.05; +% because of this: "The coffee tastes [the same] as it did last week" + +% Multi-word punctuation error: writing "its" when "it's" was meant. +% its.#it-is: [it_is]0.2; + +% Archaic, poetic 'tis +% 'tis.#it-is: [it_is]; + +'tis: Wn- & O+; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Morphology guessing for unknown words. % Given a particular kind of ending to a word, try to guess @@ -12378,7 +12587,9 @@ tonite.#tonight: [tonight]0.05; % latin (postposed) adjectives or latin plural noun % always considered as nouns in the current version % XXX maybe should be same as words.n.2.x instead of ??? +% e.g. blahblahgenesis is not plural. : + []0.1 or []0.1; % latin (postposed) adjectives or latin singular noun diff --git a/data/en/4.0.dict.m4 b/data/en/4.0.dict.m4 index 0856fff..171f42d 100644 --- a/data/en/4.0.dict.m4 +++ b/data/en/4.0.dict.m4 @@ -19,8 +19,8 @@ changecom(`%') % % %***************************************************************************% -% Dictionary version number is 5.5.0 (formatted as V5v5v0+) -: V5v5v0+; +% Dictionary version number is 5.5.1 (formatted as V5v5v1+) +: V5v5v1+; : EN4us+; % _ORGANIZATION OF THE DICTIONARY_ @@ -136,11 +136,14 @@ nonCAP.zzz: ZZZ-; % e.g. "Got it from the Abbey of Stratford Langthorne" % links "of" to "Abbey" instead of "it". % +% (Js- & {Jk-}): Allows back-link to conjunction: +% e.g. "... to look at and listen to everything" +% % Ss*s+: blocks links to Ss*t- which accepts singular subject, but % requires plural object. See "are.v" for examples. % : - (Ss*s+ & ) or SIs- or (Js- & {Mf+}) or Os- + (Ss*s+ & ) or SIs- or (Js- & ({Jk-} or {Mf+})) or Os- or or ; @@ -257,7 +260,7 @@ nonCAP.zzz: ZZZ-; % "of" gets priority in modifying the and.j-n instead of "recommendations". % However, this cost then causes the following to parse incorrectly: % "...went to hell yesterday and heaven on Tuesday." -% Arghh... +% Arghh... only semantic disambiguation will work here. : ({@M+} & SJls+) or ({[@M+]} & SJrs-); : ({[@M+]0.4 or Mp+} & SJlp+) or ({[@M+]1.4 or [Mp+]} & SJrp-); : ({[@M+]0.4 or Mp+} & SJlu+) or ({[@M+]1.4 or [Mp+]} & SJru-); @@ -297,7 +300,8 @@ nonCAP.zzz: ZZZ-; % PFd+: prevent links to PFt- : [dWp- & (dPFb+ or dPFd+)]0.1; -% The use of COa here needs to be carefully re-examined; it is used much too freely. +% The use of COa here needs to be carefully re-examined; +% it is used much too freely. % COa+ is used to block links to COd- % Xc+ & Ic+: connect to imperatives (infinitive verbs): "Anyhow, don't" % Wc- & Xc+ & Qd+: subject-object inversion: "anyhow, am I right?" @@ -884,17 +888,20 @@ majority.n minority.n bunch.n batch.n bulk.n handful.n group.n: or ({Ds**c-} & ) or Us-)); -% This gets a cost, so that the {Jd-} link for measures.1 is preferred. +% []: costly, so that the {Jd-} link for measures.1 is preferred. kind_of: [] or EA+ or EE+ + or Em+ or Wa-; -% This gets a cost, so that the {Jd-} link for measures.1 is preferred. +% []: costly, so that the {Jd-} link for measures.1 is preferred. +% Em+: "she sort of hangs from his neck" type_of sort_of breed_of species_of: [] or [Us-] + or Em+ or [Wa-]; % This gets a cost, so that the {Jd-} link for measures.2 is preferred. @@ -1309,7 +1316,7 @@ she he: % The E- is for "It's either us or them" ... not ideal, but OK % See also me.p below. me him: - J- or Ox- or ({[[E-]]} & SJl+) or SJr-; + J- or Ox- or ({[[E-]]} & SJl+) or SJr- or Wa-; % DD+: "... how us two should work together" us: @@ -1378,8 +1385,7 @@ you: thou: Sp+ & ; -% Y'gotta, Y'gonna -Y' y' y'all: (Sp+ & ) or SIp-; +y'all: (Sp+ & ) or SIp-; % basilect you % Pg+: "yo leavin' already?" verb "are" is missing. @@ -1545,8 +1551,9 @@ half: {EN-} & % "How many years" -- prefer TQ+ over Dmc+ % OFd+ & Dmc+: "I drank many of the beers" +% Naked H+: "How many?" many: - (H- & ([[Dmc+]] or ND+ or NIn+ or TQ+)) + (H- & ([[Dmc+]] or ND+ or NIn+ or TQ+ or [[()]])) or (AM- & (Dmcy+ or Oy- or Jy-)) or ({EE-} & (ND+ or NIn+)) or ({DD-} & {EAx-} & Dmc+) @@ -1645,7 +1652,8 @@ such_an: Ds*kv+ or ( & Ds*kx+); % "all of the time". These are all temporal modifiers: use MVw ("when") % and use OFw to force linkage only to time exprs. -: MVw- & OFw+; +% OFw+ & Xc+ CO+: "Some of the time, I really hate it." +: (MVw- & OFw+) or (OFw+ & Xc+ & CO+); a_lot: [[]] @@ -1682,6 +1690,7 @@ a_few: % OFd+ & Dm+: "I ate some of the cookies"; cost to , so % that this comes first. % : "I saw him some of the time" +% {COw+} & : some: D+ or (OFd+ & Dm+ & {EC-}) @@ -1734,7 +1743,8 @@ all.e: or [[]]; % "he likes you least of all" has no determiner, just uses MVa-. -least.a: EA+; +% A+: "I shall retain every least word" +least.a: EA+ or [A+]; least.e: {DD-} & MVa- & {Mp+}; none: @@ -1892,12 +1902,14 @@ not_enough: or MVp- or Pp- or FM- or (Xc+ & Xd- & (MVx- or MX-)))); -and.j-ru: - (NIfn- & {NIr-} & NItn+ & (NM- or Jp- or - (NN+ or [[NF+]] or ({EN- or NIc-} & (ND+ or OD- or - ({{@L+} & DD-} & (Dmcn+ or ( & [])))))))) or +% MVa+: "survivors differ from comparisons (5 vs. 6, respectively)" +and.j-ru vs.j-ru vs..j-ru versus.j-ru v.j-ru v..j-ru: + (NIfn- & {NIr-} & NItn+ & (NM- or Jp- or EQ- or + (NN+ or [[NF+]] or ({EN- or NIc-} & (ND+ or OD- or + ({{@L+} & DD-} & (Dmcn+ or ( & []))))))) + & {{Xca+} & MVa+}) or (NIfu- & {NIr-} & NItu+ & - ((( & ( or Bsm+)) or (Us- & {Mp+})) or AN+ or Yd+ or Ya+)); + ((( & ( or Bsm+)) or (Us- & {Mp+})) or AN+ or Yd+ or Ya+)); % and.j-sum is used in numerical sums: "It's a hundred and two in the shade." % It's a hundred 'n two in the shade." @@ -2112,12 +2124,15 @@ thirty-first.ti .ti: TM-; % connector, although e.g. "point 1/2" would appear reasonable. Go through % these and add NM- analogously to other numbers as applicable. -twenties thirties, forties fifties sixties seventies eighties nineties +twenties thirties forties fifties sixties seventies eighties nineties hundreds.cnt: - {NA-} & {TA-} & DG- & (IN- or [[]]); + ({NA-} & {TA-} & DG- & (IN- or [[]])) or + ; % teens could be above or teenagers (words.n.2) -teens: ({TA-} & DG- & (IN- or )) or ; +teens: + ({TA-} & DG- & (IN- or )) or + ; hundred thousand half-thousand million half-million quarter-million billion half-billion quarter-billion trillion half-trillion @@ -2386,9 +2401,13 @@ per "/.per": Us+ & Mp-; : {@E-} & (Pg- or Mg-); % Pv- & OFj+: "knowledge was gained of the activities" -: {@E-} & ((Pv- & {hPFt-} & {} & {OFj+}) or Mv-) & ; -: {@E-} & ((Pv- & {hPFt-} & {} & {K+}) or Mv-) & ; -: {@E-} & ((Pv- & {hPFt-} & {}) or Mv-); +: + ({@E-} & ((Pv- & {hPFt-} & {} & {OFj+}) or Mv-) & ) + or ({EA-} & Wx-); +: + ({@E-} & ((Pv- & {hPFt-} & {} & {K+}) or Mv-) & ) + or ({EA-} & Wx-); +: {@E-} & ((Pv- & {hPFt-} & {}) or Mv- or ({EA-} & Wx-)); : or ; % used only in "as " constructions, which behave @@ -2464,8 +2483,7 @@ per "/.per": Us+ & Mp-; % : allows use of gerunds as nouns. : ( & - (Dmu- or [[()]]) & - (({[[Ds-]]} & OF+) or [[()]]) & + (Dmu- or ((Dmu- or [[Ds-]]) & OF+) or ()) & (( & {@MXs+} & ((Ss+ & ) or SIs- or Os- or J-)) or AJra- or AJla+ or @@ -2492,13 +2510,14 @@ per "/.per": Us+ & Mp-; % Qw- & : "Where are they?" -- verb must connect to wall. % Qe-: "How many times did you do it?" % Qd-: "Does he drink?" -- Qd connects directly to wall. +% {CO-} & Qd-: "By the way, does he drink?" % Iq-: "The big question is did he do it?" % Xd- & Iq-: "The big question is, did he do it?" : Rw- or ({{Xd-} & Iq-} & (Qd- or ((Qw- or Qe-) & ))) or [()]; % Just like above, but no aux, should always be anded with I+. % The idea here is that the verb on the other end of the I+ will % connect to the wall. -: Rw- or ({{Xd-} & Iq-} & (Qd- or Qw- or Qe-)) or [()]; +: Rw- or (({{Xd-} & Iq-} or {COw-}) & (Qd- or Qw- or Qe-)) or [()]; % These are the verb-form expressions for special verbs that can take % filler-"it" as a subject. @@ -2575,13 +2594,13 @@ per "/.per": Us+ & Mp-; : {@E-} & VJr-; : {@E-} & VJl+; : {@E-} & VJr*i-; -: ({@E-} & VJl*i+); +: {@E-} & VJl*i+; : {@E-} & VJr*t-; : {@E-} & VJl*t+; : {@E-} & VJrg-; : {@E-} & VJlg+; -: {@E-} & VJrh-; -: {@E-} & VJlh+; +: {@E-} & (VJrh- or MJrv-); +: {@E-} & (VJlh+ or MJlv+); : or @@ -2598,12 +2617,15 @@ per "/.per": Us+ & Mp-; % XXX TODO: do the above, as they show up... % % plural-or-infinitive macro; -% "Scientists sometimes may repeat experiments or use groups." +% "Scientists sometimes may repeat experiments or use groups." % Want "groups" to connect to "use", not "and". +% (($1) or [()]) & ): +% "they might supplement or replace anticoagulants" +% The first verb is expecting an object, but there isn't one. define(`VERB_PLI',`' (( & ($1)) or ( & (($1) or ())) or - (($1) & ))) + ((($1) or [()]) & ))) % Generic singular intransitive form define(`VERB_x_S',`' @@ -2802,7 +2824,8 @@ have.v: or ((SIp+ or SFIp+) & (( & PP+) or CQ-)); %I've they've you've we've: PP+ & ; -’ve 've: Sp- & PP+; +’ve 've: + Sp- & & (PP+ or O+); has.v: VERB_X_S() @@ -2849,6 +2872,8 @@ hadn't.v-d hadn’t.v-d: or ({@E-} & (S- or SFs- or SFp- or (RS- & B-)))) & (PP+ or ((([[O+]] & ) or [[()]]) & )); +% ----------------------------------------------------------- +% "to be" % Give [K+] a cost so as to prefer Pp+ in general %: % ({@EBm+} & (((O*t+ or [B**t-] or [K+] or BI+ or OF+ or PF- or @@ -2862,6 +2887,10 @@ hadn't.v-d hadn’t.v-d: % ({N+} & (AF- or Pv+ or I*v+)) or % (({N+} or {Pp+}) & Pg*b+); +% But first, some wack idiomatic phrases that behave like "to be" +% Ix- & Pv+: "You may rest assured" +rest.w: Ix- & Pv+; + % no-obj is costly but allows "if it weren't for Sally" % [Cet+]: elided (silent "that"): "my guess is the door on the left hides the prize." % which really should be: "my guess is [that] the door on the left hides the prize." @@ -2888,12 +2917,13 @@ hadn't.v-d hadn’t.v-d: : ({@EBm+} & (( ([{CV-} & B**t-] + or (B**t- & ) or [K+] or ( & BI+) or ( & OF+) or (Osi+ & R+ & Bs+ & ) or (Opi+ & R+ & Bp+ & ) - or ([[()]] & )) & ) + or ([()]0.666 & )) & ) or ( & Pp+ & {THi+ or @MV+}) or THb+ or @@ -3158,6 +3188,7 @@ wouldn't wouldn’t: ( & {@E-} & (({RT+} & I+) or [[()]])) or ({@E-} & (({RT+} & I+) or [[()]]) & ); +% =================================================================== % EQUATIONS ETC. % % The below is just barely enough to parse just very simple equations @@ -3172,7 +3203,7 @@ wouldn't wouldn’t: % e.g. "( p < 0.01 )" for "( p is less than 0.01 )" % The parenthetical remarks must be offset by parenthesis, and % must link back to main clause with MV or MX. -=.v <.v >.v =<.v >=.v ==.v eq.v ne.v lt.v lte.v le.v gt.v gte.v ge.v +=.v <.v >.v =<.v >=.v ==.v ":.eq" eq.v ne.v lt.v lte.v le.v gt.v gte.v ge.v equiv.v sim.v simeq.v approx.v ~.v ~.v equals.eq is_less_than is_greater_than is_equal_to @@ -3193,13 +3224,16 @@ is_less_than_or_equal_to is_gretr_than_or_equal_to: % Binary operators, strict: % Here EQt attaches only to terms, which may be numbers or letters. % By contrast, EQrr can only attach to relations (=, < > etc.) -+.eq -.eq *.eq "/.eq" x.eqn plus.eq minus.eq times.eq divided_by: - (EQt+ & EQt- & (EQrr- or EQrr+ or AN+)) - or (EQt+ & Xc+ & EQt- & Xd- & (EQrr- or EQrr+ or AN+)) +% Negative cost is used to establish operator precedence; +% viz, these are lower cost than relations. ++.eq -.eq *.eq "/.eq" x.eqn plus.eq minus.eq times.eq divided_by +±.eq "+/-.eq": + (EQt+ & EQt- & ([EQrr- or EQrr+]0.1 or AN+ or NIfn+ or NItn-)) + or (EQt+ & Xc+ & EQt- & Xd- & ([EQrr- or EQrr+]0.1 or AN+ or NIfns+ or NItn-)) or (EQt- & Xd- & EQt+ & EQt- & Xc+) or (Xd- & EQt+ & EQt- & Xc+ & EQt+); -% turnstiles, implication, assignment +% turnstiles, entailment, implication, assignment ->.eq -->.eq "|-.eq" "|=.eq" ":-.eq" ":=.eq" <-.eq <--.eq : (S- & O+ ) & (AN+ or (Xd- & Xc+ & MX-)) & ; @@ -3207,6 +3241,9 @@ is_less_than_or_equal_to is_gretr_than_or_equal_to: =.eq <.e =<.e <=.e >.e >=.e +.e -.e <<.e >>.e x.e: EN+; +mean.eq avg.eq avg..eq average.eq sum.eq difference.eq total.eq: + EQt+; + % =================================================================== % COMMON VERB CATEGORIES (The last number of the file name indicates % the verb form: 1=plural-infinitive, 2=singular, 3=past("ed"), @@ -3455,6 +3492,7 @@ rising.v falling.v: % "What are the chances she will DRIVE him up to the farm?" % % No Pa links here: *they're building a skyscraper tall +% *ours works more elegant than yours % % [A+]0.5: He was xxx'ed there should have xxx as verb not adjective. % @@ -3468,10 +3506,14 @@ rising.v falling.v: VERB_PLI(); /en/words/words.v.6.2: VERB_S_T(); + +% : "Above him hung a lamp" +% However, not every verb listed would be used like that. /en/words/words.v.6.3: VERB_SPPP_T() or ( & {K+} & ) or or + or ({K+} & ); split.v-d spread.v-d fit.v-d shut.v-d cast.v-d: @@ -3634,6 +3676,7 @@ running.g beating.g catching.g driving.g striking.g: /en/words/words.v.4.3: VERB_SPPP_T() or ( & {{Xc+} & Pa+}) + or ( & Xc+ & Pa+) or or ; @@ -3854,10 +3897,10 @@ endeavoured.v-d condescended.v-d deigned.v-d: VERB_SPPP_I(); endeavouring.v condescending.v deigning.v: ( & ) or ; -: {@MV+} & { or THi+}; -happen.v occur.v: VERB_PLI(); -happens.v occurs.v: VERB_S_I(); -happened.v-d occured.v-d occurred.v-d: VERB_SPPP_I(); +: {@MV+} & { or THi+} & {VC+}; +happen.v occur.v: VERB_Y_PLI(); +happens.v occurs.v: VERB_Y_S(); +happened.v-d occured.v-d occurred.v-d: VERB_Y_SPPP(); happening.v occuring.v occurring.v: ( & ) or ; % : a subset of , used for urges/desires @@ -4150,6 +4193,8 @@ reigned.v-d ruled.w-d: VERB_SPPP_I(); reigning.v ruling.w: ( & ) or ; % O+ & K+: "She looked him over." +% O+ & MV+: "I'll look her in the eye" +% Must have at least one copy of MV+, to block "she looked him" % MVa+ connects to adverbs. % Pa+ connects to common adjectives (predicative adjectives) % K+ connects to particles. @@ -4157,7 +4202,8 @@ reigning.v ruling.w: ( & ) or ; % [K+]0.2: prefer Pa+ to K+ whenever possible: "She looked up" : {({@MV+} & (LI+ or [{Xc+} & Pa+]0.1)) or ({[K+]0.2 or AF-} & ) - or ((O+ & K+) & )}; + or (O+ & K+ & ) + or (O+ & MV+ & )}; look.v: VERB_PLI(); looks.v: VERB_S_T(); looked.v-d: VERB_SPPP_T(); @@ -4331,7 +4377,7 @@ meaning.v arranging.v threatening.v pledging.v: : or - ({@MV+} & { or TH+ or Zs- or }); + ({@MV+} & { or TH+ or Zs- or or VC+}); plan.v confess.v: VERB_PLI(); plans.v confesses.v: VERB_S_T(); planned.v-d confessed.v-d: @@ -4394,21 +4440,29 @@ proposed.v-d: proposing.g: ( & ) or ; proposing.v: & ; -: or -({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); +: + + or (OF+ & ) + or ({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); demand.v: VERB_PLI(); demands.v: VERB_S_T(); -demanded.v-d: VERB_SPPP_T() or or -; +demanded.v-d: + VERB_SPPP_T() + or + or ; demanding.v: & ; demanding.g: ( & ) or ; -: {} or -({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); +: + {} + or (OF+ & ) + or ({@MV+} & (( or TH+ or Z- or TS+ or ((SI*j+ or SFI**j+) & I*j+)))); beg.v plead.v: VERB_PLI(); begs.v pleads.v: VERB_S_T(); -begged.v-d pleaded.v-d: VERB_SPPP_T() or or -; +begged.v-d pleaded.v-d: + VERB_SPPP_T() + or + or ; begging.v pleading.v: & ; begging.g pleading.g: ( & ) or ; @@ -4476,9 +4530,12 @@ beginning.v continuing.v ceasing.v: & ; start.v stop.v try.v: VERB_PLI(); starts.v stops.v tries.v: VERB_S_T(); + +% & Xc+ & Pa+: "he stopped, unable to continue" started.v-d stopped.v-d tried.v-d: VERB_SPPP_T() or ( & {K+} & ) or + ( & Xc+ & Pa+) or ({K+} & ); starting.g stopping.g trying.g @@ -4647,6 +4704,7 @@ foreseen.v: ( & {@MV+ or THi+}) or or ; + declaring.g fearing.g concluding.g suspecting.g conceding.g presuming.g foreseeing.g emphasizing.g maintaining.g acknowledging.g noting.g confirming.g stressing.g assuming.g: @@ -4656,6 +4714,8 @@ presuming.v foreseeing.v emphasizing.v maintaining.v acknowledging.v noting.v confirming.v stressing.v assuming.v: & ; +% --------------------------------------------------------------- + : {} or ({@MV+} & ( or TH+ or RSe+)); believe.v answer.v worry.v protest.v: VERB_PLI(); @@ -4702,12 +4762,13 @@ figuring.v: & ; % (QI+ & {MV+}): "I did not say why until recently" : - or ({@MV+} & ( or TH+ or RSe+ or Zs-)) + or ({@MV+} & ( or TH+ or RSe+ or Zs- or VC+)) or ({@MV+} & (QI+ & {MV+})); +% See also: words.v.10 for paraphrasing verbs % I- & B- & : "What did John say you should do?" predict.v realize.v discover.v determine.v announce.v say.v mention.v admit.v -recall.v reveal.v divulge.v state.v observe.v indicate.v +recall.v reveal.v divulge.v state.v observe.v indicate.v stammer.v bawl.v analyse.v analyze.v assess.v establish.v evaluate.v examine.v question.v test.v hypothesize.v hypothesise.v document.v envisage.v: VERB_PLI() @@ -4715,7 +4776,7 @@ hypothesize.v hypothesise.v document.v envisage.v: predicts.v realizes.v discovers.v determines.v announces.v says.v mentions.v admits.v recalls.v reveals.v divulges.v states.v observes.v -indicates.v +indicates.v stammers.v bawls.v analyses.v analyzes.v assesses.v establishes.v evaluates.v examines.v questions.v tests.v hypothesizes.v hypothesises.v envisages.v documents.v: @@ -4723,7 +4784,8 @@ documents.v: predicted.v-d realized.v-d discovered.v-d determined.v-d announced.v-d mentioned.v-d admitted.v-d recalled.v-d revealed.v-d divulged.v-d -stated.v-d observed.v-d indicated.v-d analysed.v-d analyzed.v-d +stated.v-d observed.v-d indicated.v-d stammered.v-d bawled.v-d +analysed.v-d analyzed.v-d assessed.v-d established.v-d evaluated.v-d examined.v-d questioned.v-d tested.v-d hypothesized.v-d hypothesised.v-d well-established.v-d envisaged.v-d documented.v-d: @@ -4741,13 +4803,13 @@ said.v-d: predicting.g realizing.g discovering.g determining.g announcing.g saying.g mentioning.g admitting.g recalling.g revealing.g -divulging.g stating.g observing.g indicating.g +divulging.g stating.g observing.g indicating.g stammering.g bawling.g analysing.g analyzing.g assessing.g establishing.g evaluating.g examining.g questioning.g testing.g hypothesizing.g hypothesising.g documenting.g envisaging.g: ( & ) or ; predicting.v realizing.v discovering.v determining.v announcing.v saying.v mentioning.v admitting.v recalling.v revealing.v -divulging.v stating.v observing.v indicating.v +divulging.v stating.v observing.v indicating.v stammering.v bawling.v analysing.v analyzing.v assessing.v establishing.v evaluating.v examining.v questioning.v testing.v hypothesizing.v hypothesising.v documenting.v envisaging.v: @@ -4989,7 +5051,7 @@ disposing.v conceiving.v: & ; or OF+) & ; speak.v: VERB_PLI(); speaks.v: VERB_S_T(); -spoke.v-d: VERB_SP_T(); +spoke.v-d spake.v-d: VERB_SP_T(); spoken.v: VERB_PP() or ( & {K+} & ) or @@ -4998,7 +5060,8 @@ spoken.v: speaking.v: & ; speaking.g: ( & ) or or ; -% @MV+: "The coffee tastes (the same) as it did last year." (do not want O for "the same") +% @MV+: "The coffee tastes (the same) as it did last year." +% (do not want O for "the same") : or ({@MV+} & ((LI+ & ) or AF- or Pa+ or OF+)) @@ -5088,7 +5151,7 @@ costing.g: ( & ) or ; find.v: VERB_PLI(); finds.v: VERB_S_T(); found.v-d: VERB_SPPP_T() or - ( & (({K+ or AF-} & ) or Pa+ or Pg+)) or + ( & (({K+ or AF-} & ) or Pa+ or Pg+)) or ({K+ or Pa+ or Pg+} & ); finding.v: & ; finding.g: ( & ) or ; @@ -5453,16 +5516,16 @@ hearing.v: & ; or ( & {TH+ or Zs- or QI+ or }) or ([[@MV+ & O*n+]]); -see.v: VERB_PLI(); -sees.v: VERB_S_T(); -saw.v-d: VERB_SP_T(); +see.v spot.v: VERB_PLI(); +sees.v spots.v: VERB_S_T(); +saw.v-d spotted.v-d: VERB_SP_T(); seen.v: VERB_PP() or ( & {Pg+ or AZ+}) or ( & {Pg+ or AZ+} & ); -seeing.g: ( & ) or ; -seeing.v: & ; +seeing.g spotting.g: ( & ) or ; +seeing.v spotting.v: & ; % ditransitive verbs -- taking direct and indirect objects : @@ -5963,12 +6026,14 @@ convincing.v persuading.v: & ; % (QI+ & {MV+}): "I did not tell why until recently" % : "He told me that Fred is dead." % {O+} & : "He told me Fred is dead." +% [()]: "only he can tell" % : (((O+ & {O*n+ or K+}) or ) & & {TH+ or RSe+ or Zs- or or QI+ or BW-}) or ({O+ & } & ) or OF+ + or [()]0.3 or (QI+ & {MV+}) or ([[@MV+ & {O*n+} & ]]); @@ -5987,10 +6052,13 @@ telling.v: & ; % basilect telling tellin': & ; +% Many other paraphrasing question words are in words.v.10 % (QI+ & {MV+}): "I did not ask why until recently" +% OF+ & : "Joseph asked of her : Who is this ?" : ({(O+ & {O*n+}) or } & & {TS+ or or (QI+ & {MV+}) or BW-}) + or (OF+ & ) or ([[@MV+ & O*n+ & ]]); ask.v: VERB_PLI(); @@ -6440,15 +6508,21 @@ ending_up: ( & ) or ; % wall connectors % The naked Wi+, without a WV+, links to imperatives: "put it on the table". % The naked Wn+, without a WV+, links to nominals: "what a shame!". +% The naked Wx+, without a WV+, links to opinions: "ruined!". % The naked Qd+, without a WV+, links to subj-verb-inverts: "are you % insane?", "Are you the one?" % XXX everywhere where Ws+ is used, should probably be !? -: hWa+ or hWi+ or hWn+ or hWw+ or hQd+; +: hWa+ or hWi+ or hWn+ or hWw+ or hWx+ or hQd+; : (hWd+ or hWp+ or hWr+ or hWq+ or hWs+ or hWj+ or hWc+ or hWe+ or hWt+ or hWo+) & ; % Paraphrasing, quotational complements: : [()]0.1; +% An entire quoted sentence. Costly, if the quotes are missing. +: + ((Xc+ or Xe+ or [()]) & QUd+ & ( or ) & {X+} & QUc+) + or [(Xc+ or Xe+) & ( or ) & {X+}]; + % Quote with or without quotation marks. % "This is a test," she said. % We should go, I agreed. @@ -6464,15 +6538,17 @@ ending_up: ( & ) or ; or ({@MV+} & ((Xd- or Xq-) & (Xc+ or Xp+ or ) & (COq+ or CP- or Eq+ or ))) or [{@MV+} & (Xc+ or Xe+ or [[()]]) & ] - or ({@MV+} & (Xc+ or Xe+ or [[()]]) - & QUd+ & ( or ) & {X+} & QUc+); + or ({@MV+} & ); % Xd- & Xc+: "If I'm right, he thought, this will work." % CPa- & Xc+: "So thinks everyone" +% CPa- & : "Spoke the king: Off with his head!" +% PF- & : "And thus spoke the king: Off with his head!" +% PF- (by itself): "And thus spoke the king" : {@MV+} & (((Xd- or Xq-) & (Xc+ or Xp+ or ) & (COq+ or CPx- or Eq+ or )) - or (CPa- & Xc+) + or ((PF- or CPa-) & { & {RW+}}) or [(Xc+ or Xe+) & ]); % filler-it: "The President is busy, it seems." @@ -6617,11 +6693,16 @@ doubling.g tripling.g quadrupling.g quintupling.g: % [Mp- & MVp-]-0.61 prefers a connection to both the noun and the % verb, helping disambiguate. The weight 0.61 plus 0.4 is greater % than one, to overcome cost on @MV+. +% +% The EA- & MX- needs to be tightened; it allows oddball constructions +% that prevent putting an EA+ on words.adv.2 (which should have EA+) : - or [Mp-]0.4 or Pp- or MVp- or [Mp- & MVp-]-0.61 - or [({Xc+ & {Xd-}} & CO+)] - or (Xd- & Xc+ & (MX*x- or MVx-)); + or [Mp-]0.4 or MVp- or [Mp- & MVp-]-0.61 + or ({EA-} & Pp-) + or (Xc+ & {Xd-} & COw+) + or [({Xc+ & {Xd-}} & (COa+ or COd+))] + or ({EA-} & Xd- & Xc+ & (MX*x- or MVx-)); % Wj- & Qd+: questions: By what means will you arrive? : @@ -6639,7 +6720,8 @@ doubling.g tripling.g quadrupling.g quintupling.g: : or [Mp-] or Pp- or MVa- or - [({Xc+ & {Xd-}} & CO+)] or + (Xc+ & {Xd-} & COw+) or + [({Xc+ & {Xd-}} & (COa+ or COd+))] or (Xd- & Xc+ & (MX*x- or MVx-)); under beneath: @@ -6660,7 +6742,7 @@ from: at toward towards without w/o.p: ({JQ+} & (J+ or Mgp+) & ) - or [MVp- & B-]; + or [MVp- & B-]; % % XXX FIXME: MVp- & J+ is wrong: "*I saw John except Fred" @@ -6737,11 +6819,13 @@ just_about nearly_about almost_about right_about: % EN- & Pp-: "you are half-way through" % EN- & J-: "He stopped, about half-way through" +% K-: "it wicks the moisture through" % right/straight through: right/straight needs to modify through, so % so that conjunctions can work correctly. through.r right_through straight_through: ({JQ+} & J+ & ( or FM-)) or (EN- & (Pp- or J-)) + or K- or [MVp- & B-]; : @@ -6847,7 +6931,7 @@ unlike: % XXX The Mp- below should be removed, and all occurrences of % Mp+ elsewhere should be replaced by (Mp+ or Mf+) % Mf- & MVp+: "She was a girl of about John's age" -of o': +of: ({JQ+} & (Js+ or Jp+ or Ju+ or Mgp+ or (QI+ & {CV+})) & (Mp- @@ -6884,7 +6968,7 @@ to.r: or [{Xd- & Xc+} & MVi-] or [] or [[R-]] )) - or (TO- & Xc+) + or ({NT-} & TO- & Xc+) or I*a+ or ({JQ+} & ([J+] or Mgp+) & ) or [MVp- & B-] @@ -6902,7 +6986,7 @@ care_of c/o: besides: {J+ or Mgp+} & ([({Xc+ & {Xd-}} & CO+)] or MVp- or ); throughout: {J+} & ([({Xc+ & {Xd-}} & CO+)] or MVp- or ); -versus v. vs. vs: (J+ & Mp-) or (G- & G+); +versus.r v..r v.r vs..r vs.r: (J+ & Mp-) or (G- & G+); worth.p: (Mp- & (J+ or OF+)) or (Paf- & Mgp+) or (Pa- & (J+ or B-)); opposite.p: J+ & ; @@ -7052,7 +7136,8 @@ somewhere someplace: or ({EL+} & (MVp- or Pp-)) or ({EL+} & {Xc+ & {Xd-}} & MVp+ & {Xc+ & {Xd-}} & COp+) or ({EL+} & {Xc+ & {Xd-}} & [[CO+]]) - or EE+; + or EE+ + or EA+; nowhere: {EL+} & (MVp- or Pp- or FM- or (Xc+ & Xd- & MVx-)); @@ -7121,7 +7206,7 @@ inside.r outside.r underneath alongside: or ({J+} & ( or FM-)); -amid plus.p minus.p via onto: +amid plus.p minus.p via onto on_to: J+ & ( or ); % Bare-naked MVp-: "I want it back" @@ -7175,6 +7260,7 @@ sideways ashore abreast aft half-way.r halfway.r two-fold downhill southward underfoot westward eastward northward overnight.r on_hold on_track in_situ in_toto off_balance +on_tiptoe in_check on_course off_course under_oath at_end by_example on_holiday by_invitation on_patrol on_stage in_step in_tempo on_schedule behind_schedule ahead_of_schedule for_good for_keeps @@ -7358,7 +7444,7 @@ ago: every.i: {EN-} & Ye+ & ; times.i x.i: - (ND- & (({Xc+ & {Xd-}} & CO+) or MVp- or EC+ or EZ+ or or Qe+)) or + (ND- & (({Xc+ & {Xd-}} & COa+) or MVp- or EC+ or EZ+ or or Qe+)) or (((({ND-} & DG-) & {}) or (ND- & Ys+)) & (({Xc+ & {Xd-}} & CO+) or MVp- or (Xd- & Xc+ & MVx-))); @@ -7509,6 +7595,10 @@ tenfold a_hundredfold a_thousandfold: {EN-} & (MVp- or Em+ or EC+ or [Pa-] or A+ % ====================================================================== % QUESTION WORDS +% Allow a question to be preceeded by a clause opener. +% "By the way, how was it?" +: {CO-} & Wq-; + % QI- & (): "I do not know who" % Ws- & Bsw+ & Sp*w+: "Who have bought your flat from?" % {EL+ & {N+}} & Wd-: "Who?" "Who else?" "Who else not?" @@ -7521,7 +7611,7 @@ who: or Jw- or ({EL+} & ((S**w+ & {Bsw+}) or (R+ & B*w+)) & {EW-} & (Ws- or Wq- or QI*d- or BIqd-)) or ({EL+ & {N+}} & Wd-) - or (Wq- & Qw+) + or ( & Qw+) or ({MVp+ or MVx+} & (S**w+ or (R+ & B*w+)) & (Xd- & (Xc+ or ) & MX*r-)); @@ -7538,7 +7628,7 @@ what: or Ss*w+ or Sp*w+ or (R+ & (Bsw+ or BW+))) - & {EW-} & (Wq- or Ws- or QI*d- or BIqd- or QJ+ or QJ-)) + & {CO-} & {EW-} & (Wq- or Ws- or QI*d- or BIqd- or QJ+ or QJ-)) or ({EL+} & Ww-) or (Wn- & O+) or ((Ss*d+ or (R+ & (Bsd+ or BW+))) @@ -7549,13 +7639,15 @@ what: or SJl+ or SJr- or (Xc+ & Ic+); -% QI- & (): "I do not know which" +% [QI-]: "I do not know which" +% (R+ & B*w+ & (QJ+ or QJ-)): "... which to pick and which to leave behind." which: ((Jr- or R-) & (({MVp+ or MVx+} & RS+) or )) or ((D**w+ or ({OF+} & (S**w+ or (R+ & B*w+)))) & {EW-} & (Wq- or Ws- or QI*d- or BIqd-)) or (JQ- & D+) or ({MVp+ or MVx+} & (S**w+ or B*w+) & ((Xc+ or ) & Xd- & MX*r-)) or [QI-] + or (R+ & B*w+ & (QJ+ or QJ-)) or Jw-; % or Wi-: "Which way, left or right?" @@ -7609,7 +7701,7 @@ whenever wherever however.c: whyever: ({EL+} & ( - (Ww- & Qw+) + ({CO-} & Ww- & Qw+) or (QI- & ( or )) or ( & ((SFsx+ & ) or WY- or BIq-)))) or [[{@CO-} & Wc- & Wi+]]; @@ -7625,7 +7717,7 @@ whichever: whence whither: {EL+} & (( & (({Xc+ & {Xd-}} & CO+) or ({Xd- & Xc+} & MVs-))) - or ({EW-} & Ww- & Qw+)); + or ({CO-} & {EW-} & Ww- & Qw+)); % Comparative-opener: "although a good worker, he's not a very good manager" : (O*c+ & {Xc+ & {Xd-}} & COc+); @@ -7654,7 +7746,7 @@ when: or MJl+ or ({JT-} & MJr- & Qw+) or ({EW-} & (QJ- or QJ+)) - or ({EW-} & Ww- & {Qw+}) + or ({CO-} & {EW-} & Ww- & {Qw+}) or (( or Mp+ or Mgp+ or Mv+) & (({Xd- & Xc+} & MVs-) or ({Xc+ & {Xd-}} & CO*s+) or (Xd- & Xc+ & E+))); @@ -7663,7 +7755,7 @@ when: % N+: "why not?" "Why the hell not?" why: {EL+} & ( - ({EW-} & (Ww- or Wq-) & {Qw+ or N+}) + ({CO-} & {EW-} & (Ww- or Wq-) & {Qw+ or N+}) or (QI- & ( or or [()])) or ( & ((SFsx+ & ) or WY- or BIq- or QJ+ or QJ-)) or COa+ @@ -7679,7 +7771,7 @@ why: where: {EL+} & ( - ({EW-} & Wq- & ((Rw+ & WR+) or (R+ & Bsw+) or Qw+)) + ({CO-} & {EW-} & Wq- & ((Rw+ & WR+) or (R+ & Bsw+) or Qw+)) or [QI-] or SJl+ or SJr- or ({EW-} & (QJ- or QJ+)) @@ -7699,12 +7791,12 @@ whether_or_not: % QI- & (): "I do not know how" % EL+: "How else would you say that?" -% (EAh+ or EEh+) & Ww-: "How big?" "How quickly?" +% (EAh+ or EEh+) & Wq-: "How big?" "How quickly?" how: ((((EAh+ or EEh+) & {HA+}) or H+ or AFh+) & {EW-} & (BIqd- or QI*d- or Wq- or Ws-)) - or ({EW-} & Ww- & [[()]]) - or ({EW-} & Wq- & (({EL+} & Qw+) or AF+)) + or [[{EW-} & Ww-]] + or ({EW-} & & (({EL+} & Qw+) or AF+)) or [QI-] or ({EW-} & (QJ- or QJ+)) or SJl+ or SJr- @@ -7771,7 +7863,9 @@ unless though.c even_though: as_if as_though: (( or Mgp+ or Mv+ or Mp+) - & (({Xc+ & {Xd-}} & CO*s+) or ({Xd- & Xc+} & MVs-) or (Xd- & Xc+ & E+))) + & (({Xc+ & {Xd-}} & CO*s+) or + ({Xd- & Xc+} & MVs-) or + (Xd- & Xc+ & E+))) or ((BIh- or LI-) & ); as_soon_as: @@ -7884,17 +7978,17 @@ and.j-g: [G- & G+]0.05; % AJ*s: superlative adjectives % and.j-a but.j-a yet.j-a and_yet: - ({Xd-} & AJla- & {EBb+} & AJr+) & (A+ or Pa- or [MVa-] or AJra-) & {}; + ({Xd-} & AJla- & {Xd-} & {EBb+} & AJr+) & (A+ or Pa- or [MVa-] or AJra-) & {}; % XJo-: either ... or ... or.j-a: - ({Xd-} & AJla- & {XJo-} & AJra+) & (A+ or Pa- or [MVa-] or AJra-); + ({Xd-} & AJla- & {Xd-} & {XJo-} & AJra+) & (A+ or Pa- or [MVa-] or AJra-); % XJn-: neither ... nor ... % Its marked optional only to solve the ugly case of % "he is in neither the 105th nor the 106th battalion" % At issue is that nouns really really want to get a determiner, so we give it one. -nor.j-a: AJ- & {XJn-} & AJ+ & (A+ or Pa- or [MVa-]); +nor.j-a: AJ- & {Xd-} & {XJn-} & AJ+ & (A+ or Pa- or [MVa-]); % comparatives: % he is bigger, and badder, than the pope. @@ -7919,25 +8013,33 @@ and.j-s: : [Ma-] or (Xd- & Xc+ & MX*a-); : Mp- or MVp- or (Xc+ & CO+); : J+ & ([Mp-] or Pp- or MVp-); +: Xd- & Mv-; % [Ma-]: it is more grammatically correct to have commas ... % {EBb+}: "blah but not blah", "blah and not blah" -but.j-m and.j-m: +% vs.: "We examined the setting (urban vs rural)" +but.j-m and.j-m vs.j-m vs..j-m versus.j-m v.j-m v..j-m: ({Xd-} & MJla- & {EBb+} & MJra+ & ) or ({Xd-} & MJlp- & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlj- & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & {EBb+} & MJrv+ & {Xc+} & ); % {XJo-}: Either .. or ... +% SJr+: "either by chemicals or hammering" as a stand-in for +% "by chemicals or by hammering" because the second "by" is a zero. +% "either by hammering or chemicals" or.j-m: ({Xd-} & MJla- & {XJo-} & {EBb+} & MJra+ & ) or - ({Xd-} & MJlp- & {XJo-} & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & {XJo-} & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlp- & {XJo-} & {EBb+} & (MJrp+ or SJr+) & ) or + ({Xd-} & MJlj- & {XJo-} & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & {XJo-} & {EBb+} & MJrv+ & {Xc+} & ); % XJn-: Neither .. nor ... nor.j-m: ({Xd-} & MJla- & XJn- & {EBb+} & MJra+ & ) or ({Xd-} & MJlp- & XJn- & {EBb+} & MJrp+ & ) or - ({Xd-} & MJlj- & XJn- & {EBb+} & MJrj+ & {Xc+} & ); + ({Xd-} & MJlj- & XJn- & {EBb+} & MJrj+ & {Xc+} & ) or + ({Xd-} & MJlv- & XJn- & {EBb+} & MJrv+ & {Xc+} & ); % Conjoined question words. % When and where is the party? @@ -8098,17 +8200,24 @@ then.j-c: {Xd-} & XJc- & VJr+; % XXX This is hacky, we should just prevent such infinitive links from % occurring at all. % {TO+}: "I aim to do something and to help." +% {N+} & {TO+}: "I aim to do something and not to complain." +% {N+}: "John wants to pay for the beer, not steal it." +% Jj- & Jk+: "... to look at and listen to everything." +% This is a link-crossing hack; see the link-crossing +% discussion in the README; see section-J.html in the docs. : (({Xd-} & VJlsi- & VJrsi+) & (({@MV+} & Ss- & ) or (RS- & Bs-) or ([I-]0.2 & {@MV+} & ) or ({Xd-} & VJrsi-))) or - (({Xd-} & VJlpi- & {TO+} & VJrpi+) & + (({Xd-} & VJlpi- & {N+} & {TO+} & VJrpi+) & (({@MV+} & Sp- & ) or (RS- & Bp-) or ([I-]0.2 & {@MV+} & ) or ({Xd-} & VJrpi-))) or + (({Xd-} & Jj- & VJlpi- & VJrpi+ & Jk+) & + ([I-]0.2 & {@MV+} & )) or (({Xd-} & VJlst- & VJrst+) & ((({@MV+} & Ss- & ) or ([I-]0.2 & {@MV+} & )) & @@ -8214,13 +8323,16 @@ thus therefore therefor: % it tastes bitter, not sweet % "not" is modifying comma % it tastes bitter and not sweet % EB- & EE+: "but not very much" -% optional {EA+} to make "he is not a good programmer" -% FIXME: it would be nice to have some + link for this case, also. +% {EA+}: "he is not a good programmer" +% FIXME: it would be nice to have some + link for this case, also. +% N- & En+: "he does not want to steal it" not.e: - (EBm- & {EA+ or EE+}) + [EBm-]0.1 + or (EBm- & (EA+ or EE+)) or (EBb- & {EA+}) or (EBx- & {EA+}) - or ({@E-} & N-) + or ({@E-} & N- & En+) + or [{@E-} & N-] or NT+ or EBy+ or @@ -8259,11 +8371,12 @@ just_not: ; % % Lots and lots, but not all ordinary adjs can take : % Pa- & : "... is too abrasive to talk to." +% {Xd-} & Pa-: "she stood there, naked" % [EAh- & {Qe+}]: "How big?" "How tall?" -- large cost, as it otherwise % causes bizarre parses for "a decidedly jolly good player" : ({EA- or EF+} & ( - ((Pa- or AF+ or Ma- or MJra-) & {@MV+} & {}) + ({Xd-} & (Pa- or AF+ or Ma- or MJra-) & {@MV+} & {}) or ({@MV+} & MJla+) or AA+ or )) @@ -8336,12 +8449,14 @@ tawny.a ultramarine.a umber.a yellow.a: ; +% Wx-: single-word opinion expression : or ({EA- or EF+} & ( ((AF+ or Ma- or MJra-) & {@MV+}) or ({@MV+} & MJla+) or AA+ or + Wx- or [[DD- & ]] or [[{DD-} & ]])); @@ -8916,8 +9031,10 @@ as.e-c: % Cz+ & CV+: "the accused, as it shall be shown, is innocent" % use Cz instead of because post-processing kills the % Cs link with a "Unbounded s domain78" error. +% {EZ-} & Cz+ & CV+: "Just as I suspected!" +% cost on EZ-: prefer just.e over just.a +% % AZ- & Mg+: "It described the treaty as marking a new stage" -% & CO+: "As we set sail, a gale blew up" % BIt+: "his statements, as candidate, contradict his actions" as.e: ((J+ or Mp+ or TI+ or Zs+) & @@ -8925,23 +9042,64 @@ as.e: or ((J+ or Mp+ or BIt+) & ([Mp-] or (Xd- & Xc+ & MX*x-))) or (AZ- & Pa+) or (AZ- & Mg+) - or ({Xd-} & {[hVCz-]-0.05} & Cz+ & CV+) + or (({[EZ-]-0.5} or {Xd-}) & {[hVCz-]-0.05} & Cz+ & CV+) % or ({Xd-} & hVCz- & Cz+ & CV+) - or ( & (({Xc+ & {Xd-}} & CO+))) or ((Sa*v+ or (Sa*a+ & CV+)) & {Xc+ & {Xd-}} & CO+) or (Sa*v+ & {Xd- & {Xc+}} & VCz-) or [Sa*a+ & CV+ & {Xd- & {Xc+}} & VCz-]-0.05 or (Sa*a+ & CV+ & {Xd- & {Xc+}}) % needed for MXsr constructions - or (MVi- & TO+) + or (MVi- & TO+ & IV+) or [[(PFc+ or CQ+) & ({Xd- & Xc+} & MVs-)]]; +% "as" as synonym for "while" +% & CO+: "As we set sail, a gale blew up" +% MVs- & Cs+ & CV+: "I slipped as I ran" +as.#while: + ( & (({Xc+ & {Xd-}} & CO+))) + or (MVs- & Cs+ & CV+); + + as_is: {Xd- & Xc+} & MVs-; as_possible: MVz-; +% "It is just like I suspected." +like.e: + ({EZ-} or {Xd-}) & {[hVCz-]-0.05} & Cz+ & CV+; + +% Em+: "That is so not going to happen" +% EExk+: "That is so very beautiful" +% EBb- & EAxk+: "It tastes bitter and so good" +% MVp- & Xc+: "Hold the brush so" +% Pv-: "It seems so" +% MVs-: "she insisted, so we will do it" +% Cz+ & CV+: "the accused, so it shall be shown, is innocent" +so.e: + ({EBb-} & EAxk+ & {HA+}) + or ({EZ-} & EExk+) + or Em+ + or + or (Wq- & CQ+) + or Wa- + or (MVp- & Xc+) + or ({Xd-} & {[hVCz-]-0.05} & Cz+ & CV+) + or Pv- + or O- + or Js-; + +and_so and_thus: + ; + +% Is ever needed here? +% Should we be using instead of MVs- ?? +% Or maybe every use of MVs- should be converted to ??? +so_that such_that: + & {Xd- & Xc+} & MVs-; + % Cc+ & CV+: C links to the head-noun of the following clause, and CV+ % links to the head verb. Must form a cycle. % Example: "I run more often than Ben climbs" +% MVp- & J+: "... other traditions than my own" than.e: (MVt- & (((O*c+ or ({SFsic+} & Zc+) or U*c+) & {Mp+}) or Mpc+ or S**c+ or MVat+ or MVpt+ or (Cc+ & CV+) or Pafc+)) @@ -8949,18 +9107,21 @@ than.e: or ((MVti- or LEi-) & AFdi+ & {Pa+}) or (((LE- & {AFd+}) or (LEi- & {AFdi+})) & (THc+ or (TOic+ & ) or (TOfc+ & ) or (TOtc+ & B+))) - or (((MVto- & Ct+ & Bc+ & {U+}) or (MVtp- & (CX+ or CQ+))) & {Mp+}); + or (((MVto- & Ct+ & Bc+ & {U+}) or (MVtp- & (CX+ or CQ+))) & {Mp+}) + or (MVp- & J+); % cost on MVa-: "we will arrive much sooner", want "much" to modify "sooner". % ({OFd+} & Dmu+): "I drank much of the beer" % cost on [[]] so that the above is preferred to an O- link +% EZ+: "Much as I expected!" much: ({EE-} & ([[MVa-]] or ( & ECa+) or or Qe+)) or ({EEx- or H-} & ( ECn+ or ({OFd+} & Dmu+) or ( & ([[]] or Bsm+)))) - or (AM- & (Dmuy+ or MVy- or Oy- or Jy- or EB*y-)); + or (AM- & (Dmuy+ or MVy- or Oy- or Jy- or EB*y-)) + or EZ+; slightly somewhat: EC+ or EA+ or MVa- or Em+; far.c infinitely: EC+; @@ -9061,7 +9222,10 @@ than_intended than_supposed than_reported than_ever than_usual than_normal than_suggested than_anticipated than_recommended: MVt-; more_than no_more_than fewer_than less_than as_many_as an_estimated -an_additional up_to as_much_as no_fewer_than no_less_than greater_than: EN+; +an_additional up_to as_much_as no_fewer_than no_less_than greater_than +upwards_of: + EN+; + at_least: EN+ or CO+ or [[{Xd- & Xc+} & MVa-]] or EB-; % This is not quite right, since there may be other words in between @@ -9189,13 +9353,15 @@ notoriously.e: % "It's an inherently better method" thus EC+ link fabulously marginally moderately relatively ridiculously: - or ({EE- or } & EC+) - or ({EE-} & EBm-); + or ({EE-} & EBm- & EC+) + or [{EE- or } & EC+] + or [{EE-} & EBm-]; incomparably inherently unacceptably unarguably undeniably unimaginably: - or ({EE- or } & EC+) - or ({EE-} & EBm-); + or ({EE-} & EBm- & EC+) + or [{EE- or } & EC+] + or [{EE-} & EBm-]; wide.e: & EE+; @@ -9219,7 +9385,8 @@ quite: amazingly incredibly: - or EBm- + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or ({Xd- & Xc+} & Em+) or ({Xc+ & {Xd-}} & CO+) or (Xd- & Xc+ & MVa-); @@ -9227,7 +9394,8 @@ amazingly incredibly: % MVa-: "He is behaving very strangely" strangely: - or EBm- + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or ({Xd- & Xc+} & Em+) or ({Xc+ & {Xd-}} & CO+) or ({Xd- & Xc+} & {EE-} & MVa-); @@ -9241,30 +9409,42 @@ rather: particularly: - or Em+ or EB- + or Em+ + or [EB- & (EC+ or EA+)]-0.5 + or [EB-] or (MVl- & (MVp+ or MVa+ or MVs+)) or ({Xc+ & {Xd-}} & CO+); notably: - or EB- or ({Xc+ & {Xd-}} & CO+); + or [EB- & (EC+ or EA+)]-0.5 + or [EB-] + or ({Xc+ & {Xd-}} & CO+); % Mp- & Ju+: "She was a girl nearly John's age" % MVp- & Ju+: "She was a girl of nearly John's age" +% [EBm- & EA+]-0.1: proiritize above naked EA+ +% almost: - or EN+ or EZ+ or Em+ or EBm- + or EN+ or EZ+ or Em+ + or [EBm- & (EC+ or EA+)]-0.5 + or [EBm-] or (MVl- & (MVp+ or MVa+ or MVs+)) or ((Mp- or MVp-) & Ju+); nearly: - - or EN+ or EZ+ or Em+ or EBm- + + or EN+ or EZ+ or Em+ + or [EBm-] + or [{EE-} & EBm- & (EC+ or EA+)]-0.5 or (MVl- & (MVp+ or MVa+ or MVs+)) or ((Mp- or MVp-) & Ju+); % The below is similar to "nearly" ... -just_about: Em+ or EN+ or EZ+ or EA+; +just_about: + Em+ or EN+ or EZ+ + or EA+; entirely: @@ -9318,6 +9498,7 @@ partly.e largely.e mostly.e chiefly.e simply.e purely.e solely.e: % Em+: "It sure is great" sure.ee: Em+; +very_much: Em+; % Em+: "It sure the fuck is great to see you, man!" % "It sure the hell is!" @@ -9582,7 +9763,8 @@ certainly possibly probably importantly remarkably interestingly: % absurdly actually additionally admittedly allegedly alternatively /en/words/words.adv.2: E+ - or (Xd- & Xc+ & (E+ or MVa-)) + or (Xd- & Xc+ & E+) + or ({Xd- & Xc+} & MVa-) or ({Xc+ & {Xd-}} & CO+) or EBm-; @@ -9710,7 +9892,7 @@ tsk tsk_tsk tsk_tsk_tsk: % as adjectives, as well. % A- & Wa-: "Holy Mother of God" howdy phew psst pssst ahem -ah ahh eh ehh hmm hmmm huh +ah ahh a_ha aha eh ehh hmm hmmm huh oops eep egad egads ermahgerd ouch alas whoa whoah oh.ij ohh doh dohh woo_hoo boo.ij booo boooo phooey pooh @@ -9810,6 +9992,7 @@ seldom rarely.e: ({EE-} & (E+ or EB-)) or ; % MVl- & MVl+: " we are going to arrive just about on time" just.e: E+ + or (EB- & EA+) or [EB-] or EC+ or EN+ @@ -9914,6 +10097,13 @@ so_on the_like vice_versa v.v.: : ( or ) & {hCPx+ or hCPi+ or hCPu+} & {(Xx+ or Xp+ or Xs+) & {hWV+}} & {RW+ or Xp+}; +% : "So, don't do it!" +% The cost on sent-start is to force preference for CV over WV, +% whenever possible. +so.ij: + (({Xd-} & ([MVs-]0.5 or ) & Xs-) or ({Xc+} & Wc-)) + & ( or []0.5); + % QU+ links to quoted phrases. % ZZZ+ is a "temporary" addition for randomly-quoted crap, and % virtual CAPs morphemes. (??) @@ -9931,39 +10121,6 @@ RIGHT-WALL: RW- or ({@Xca-} & [[Xc-]]); % mid-text period, question mark. Splits into two sentences. : Xp- & ; -% In many ways, "so" acts as a synonym for a semicolon... -% : "So, don't do it!" -% The cost on sent-start is to force preference for CV over WV, -% whenever possible. -% Em+: "That is so not going to happen" -% EExk+: "That is so very beautiful" -% EBb- & EAxk+: "It tastes bitter and so good" -% MVp- & Xc+: "Hold the brush so" -% Pv-: "It seems so" -% MVs-: "she insisted, so we will do it" -so: - ({EBb-} & EAxk+ & {HA+}) - or ({EZ-} & EExk+) - or Em+ - or ((({Xd-} & ([MVs-]0.5 or ) & Xs-) or ({Xc+} & Wc-)) - & ( or []0.5)) - or - or (Wq- & CQ+) - or Wa- - or (MVp- & Xc+) - or Pv- - or O- - or Js-; - -and_so and_thus: - ; - -% Is ever needed here? -% Should we be using instead of MVs- ?? -% Or maybe every use of MVs- should be converted to ??? -so_that such_that: - & {Xd- & Xc+} & MVs-; - % Quotation marks. % TODO: Add ' as quotation mark. % For a list see: @@ -9983,7 +10140,7 @@ so_that such_that: % For now, using ".x and ".y in the above definitions multiplies the number % of linkages by 2^(number of "). So it is separated below. -% [[ZZZ-]]: link to "random" quotion marks that show up "for no reason". +% [[ZZZ-]]: link to "random" quotation marks that show up "for no reason". % Cannot use a blanket W+ here to pick up all W connectors, because ... ?? """: QUd- or or [[ZZZ-]]; @@ -10042,12 +10199,16 @@ changequote dnl % cost on []: allow Pa links with commas, e.g. % "he paced, worried" but lower cost than Xx links % +% SJl- & J- & SJr+: "by the A, the B..." +% This is a tiny part of and.j-n, but we do not want the full +% complexity of and.j-n here, since the commas force this. ",": ({[@Xca-]-0.05 or [[[@Xc-]]]} & (({[EBx+]} & Xd+) or Xc-)) or [] or or or []0.5 + or (SJl- & J- & SJr+) or (SJl- & SJr+ & SJl+); % :.j @@ -10221,6 +10382,54 @@ thru.#through-r: [through.r]0.05; nite.#night: [night.r or night.u or night.i or night.n]0.05; tonite.#tonight: [tonight]0.05; +% Y'gotta, Y'gonna +% "keep y'mouth shut" +y'.#you: [you]0.05; +y'.#your: [your]0.05; + +o'.#of: [of]0.05; + +e.#he: [he]0.05; + +be.#by: [by]0.05; +de.#the: [the]0.05; + +drinkin.#drinking-v: [drinking.v]0.05; +drinkin'.#drinking-v: [drinking.v]0.05; +runnin'.#running-v: [running.v]0.05; +kidnappin'.#kidnapping-v: [kidnapping.v]0.05; + +an'.#and-j-n: [and.j-n]0.05; +an'.#and-j-v: [and.j-v]0.05; + +% A bit too loose. These should only become enabled if the context +% is correct. +% an.#and-j-n: [and.j-n]; +% an.#and-j-v: [and.j-v]; + +% Bad German accent +vas.#was-v-d: [was.v-d]0.05; +vas.#what: [what]0.05; +das.#this-p: [this.p]0.05; +das.#this-d: [this.d]0.05; + +% Colloquial usages of "as": +% "I don't know as I can answer your question." +as.#that: [that.j-c]0.05; + +% Desirable multi-word substitutions: +% as.#same-as: [the_same_as]0.05; +% because of this: "The coffee tastes [the same] as it did last week" + +% Multi-word punctuation error: writing "its" when "it's" was meant. +% its.#it-is: [it_is]0.2; + +% Archaic, poetic 'tis +% 'tis.#it-is: [it_is]; + +'tis: Wn- & O+; + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Morphology guessing for unknown words. % Given a particular kind of ending to a word, try to guess @@ -10303,7 +10512,9 @@ tonite.#tonight: [tonight]0.05; % latin (postposed) adjectives or latin plural noun % always considered as nouns in the current version % XXX maybe should be same as words.n.2.x instead of ??? +% e.g. blahblahgenesis is not plural. : + []0.1 or []0.1; % latin (postposed) adjectives or latin singular noun diff --git a/data/en/4.0.knowledge b/data/en/4.0.knowledge index 6e77786..ad1f305 100644 --- a/data/en/4.0.knowledge +++ b/data/en/4.0.knowledge @@ -317,7 +317,7 @@ B#m , D##w H HA , "Bad use of gerund68" CONTAINS_NONE_RULES: S , Spxi , "Bad n-v agreement69" , - SI , SIpxi , "Bad n-v agreement70" , + SI , SIpxi , "Bad n-v agreement70" , Ws , B#m Ca BT , "Question inversion violated71" , SF , I* PP* TO* Pa* Pam Pg* Pv* LE* AFd* MVta , "Bad use of 'filler' subject72" , @@ -327,7 +327,9 @@ CONTAINS_NONE_RULES: , "Bad use of 'filler' subject74" , MXsr , Sp#w , "Bad n-v agreement75" , MXpr , Ss#w S#iw , "Bad n-v agreement76" , - Mr , B#* , "Bad use of 'whose'77" + Mr , B#* , "Bad use of 'whose'77", + EAy , MVs , "Bad comparative78", + VCz , EAy , "Bad comparative79", ; ---------------------------------------------------------------------- diff --git a/data/en/4.0.regex b/data/en/4.0.regex index 5d187fd..4ca6fe8 100644 --- a/data/en/4.0.regex +++ b/data/en/4.0.regex @@ -216,6 +216,9 @@ : /^\w.+ive$/ : /^\w.+ble$/ +% Usually capitalized place names: Georgian, Norwegian +: /^\w.+ian$/ + % latin (postposed) adjectives % influenzae, tarentolae % pentosaceus, luteus, carnosus diff --git a/data/en/Makefile.in b/data/en/Makefile.in index 3886cd5..c5049d8 100644 --- a/data/en/Makefile.in +++ b/data/en/Makefile.in @@ -184,7 +184,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in README missing +am__DIST_COMMON = $(srcdir)/Makefile.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ diff --git a/data/en/corpus-basic.batch b/data/en/corpus-basic.batch index 96fac0c..4b90c47 100644 --- a/data/en/corpus-basic.batch +++ b/data/en/corpus-basic.batch @@ -437,7 +437,9 @@ But I really wanted to see her As I suspected, he had already left *Because I suspected, he had already left *I suspected, he had already left -*I suspected + +% "Yes, I suspected" is a grammatically valid reply to a question. +% *I suspected Some grammars are better than others, as we have proved As had been expected, the party was a big success *As had been green, the party was a big success @@ -699,6 +701,7 @@ She is apparently an excellent pianist *She married apparently an excellent pianist Only after the movie did he realize his mistake *After the movie did he realize his mistake +After the movie, did he realize his mistake? I may have taken cocaine a few times, but at no time did I inhale *A few times may I have taken cocaine, but I inhaled at no time Never have I seen such a grotesque display of incompetence diff --git a/data/en/corpus-fixes.batch b/data/en/corpus-fixes.batch index 4eac431..9fd4a5c 100644 --- a/data/en/corpus-fixes.batch +++ b/data/en/corpus-fixes.batch @@ -94,6 +94,7 @@ he cut out after fifth period he cut class after fifth period he cut out when the phone rang he dropped out after fifth grade +they wick the moisture through we deliver! he really delivers, doesn't he? @@ -104,10 +105,47 @@ He puts forward an argument against sexism The Vatican declaration put forward an argument against sexism He poots forth a quarter-ounce green rosette near the summit of a dense but radiant muffin of his own design -It has a hardness of 0.34 Brinell units. -It has a tensile toughness of 0.34 joules per cubic metre - +only he can tell +he was the only one who told +he is the only one who is telling + +only an experienced eye can tell which to pick +only an experienced eye can see which to pick +only an experienced eye can spot which to pick +only an experienced eye can spot which to pick and which to leave behind. +... which to pick and which to leave behind. + +Off with his head! +They're gonna off him at midnight + +% paraphrasing verbs +he stammered that he did not mean it +Not again, snorted Ken +Her ? squeaked Albert. +Spies ! squealed Angelina +Who are you ? she questioned abruptly. +Joseph asked of her : Who is this ? +Joseph begged of her : Who is this ? +Joseph demanded of her : Who is this ? + +% Subject-inverted paraphrasing +Said the King: "Off with his head!" +spoke the King: "Off with his head!" +Pronounced the King: "Off with his head!" +Uttered the knave: "Don't do that!" +Muttered the knave: "Oh no!" + +"I don't like that", spoke the king. +thus spake the king: "go forth!" +and thus spoke the king: "go forth and multiply!" +and thus spoke the king: go forth and multiply! +and so spoke the king. + +% verb "suspect" was buggy. I beleive he suspects +I told you that he suspects +A ha, just as I suspected! +yes, so I suspect he suspects already he will suspect soon he knows already @@ -161,6 +199,7 @@ John is bigger than Dave is. John wants more cookies than Dave wants. It was covered with bites. Alice took a bite out of it. +I very much welcome the fact that ... % Leasing and subleasing. It's to let. @@ -384,8 +423,14 @@ how the fuck do I know? whyever for? what for? + +% "how" is broken and hard to fix without breaking basic corpus. How come? +How many are there? +How many more? How many? +How much is that? +how much? How? How quickly? @@ -400,6 +445,11 @@ How big did you say it was? How high did you say it was? How tall did you say he was? +How ridiculous +How perfectly ridiculous +How strange +How odd! + % Arghhh this is a mess. Some of these want to use AF+, % others seem to be more comfortable with Qe+ and its not clear % how to be consistent. @@ -491,6 +541,28 @@ The unlinks are detected by the Khovanov homology over Z. The inlining of that subroutine blows up the object. equivariant cohomology is a cohomology theory from algebraic topology. +have some salad greens +He escaped from his confines +They were both in their fifties +They were both in their early teens + +Just use the wash basin +There was a bucket of liquid in the middle of the room + +% Misc mass nouns, and thier interactions with the regex subsystem +% for handling unknown words. +Vitamin D has a crucial role for bone metabolism. +Dry eye syndrome is a common irritating eye disease. +Immune system function declines with age. +Cognitive function was genetically related to pulmonary function. +Aerobic exercise has been suggested to ameliorate aging-related decline in humans. +The pathogenesis of aging-associated structural changes is not completely understood. +AKT inhibition either by chemical inhibitors or small interfering RNAs induced telomere dysfunction. +Late-onset hypogonadism is a relatively common condition affecting the aging male. +Cardiovascular disease risk factors may be important correlates of age-related auditory dysfunction. +Endothelial dysfunction in essential hypertension is an independent predictor for future cardiovascular events. + + % Misc Latin abbreviations Kentaro Hori, et al. wrote the book "Mirror Symmetry". I saw the deputy head re the incident @@ -902,6 +974,10 @@ I have a type of talent. I have a sort of talent. I have a breed of goats. +she sort of hangs from his neck + +they've a habit of coming up smelling of roses. + Copelatus stavropolitanus is a species of diving beetle. What degree of trust do you put in him? @@ -981,6 +1057,14 @@ In the corner lay a lamp. *In the corner lay it. Under that tree sleeps only Larry. +Above him hung a map + +Below him was a rod, somewhere below the lower extent of his field of vision. +Below him was a rod, almost below the lower extent of his field of vision. +Below him was a rod, nearly below his field of vision. +Below him was a rod, just below his field of vision. +Below him was a rod, nearly out of sight +Below him was a rod, very nearly out of sight % Verb-object inversion % .. and verb-object inversion with null copula. @@ -1178,6 +1262,9 @@ She carefully looked him over in London. She sounded him out. She sounded him out when he got back to London. +I'll look her straight in the eye +I'll look Joan straight in the eye + He drew me a picture. She bore me a child. She bore me. @@ -1338,6 +1425,8 @@ John imagined Mary as innocent as a lamb. Arkansas has become a favorite place for older people to retire. Global Trotter, a favorite, seems unlikely to place. +I shall retain every least word + % Superlatives without preceeding determiners. He likes you best. He bores you most. @@ -1647,6 +1736,8 @@ He coughed, clearing his throat He stumbled unseeing through the darkness He stumbled, eyes blinded by the sudden light He stumbled, blinded by the sudden light +He halted, unable to continue +He stopped, unable to continue %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%% particles %%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1666,6 +1757,7 @@ She was beckoning in that dress. He pulled himself upright. He uprighted the fallen vase. It flexed once or twice in her hand. +she stretches up on tiptoe to reach him The economy weakened as prices spiraled up. Shares slid $2.66 in Big Board trading. @@ -2318,6 +2410,8 @@ Here lies the book here rests the remains there rest the remains of St. Stephen +You may rest assured I shall fulfill my duties + Nearby is another temple that honors his wife. Close by is another temple. Nearby are more ruins. @@ -2366,7 +2460,10 @@ He's out on the town. He looked at the girl who'd been knitting +% =============================================================== % Problems with "as" .... as.e as adverb +% Also "so" can be sometimes used in a similar fashion to "as" +% It is no longer portrayed as having the power to protect against sin. You are portrayed as having the power to make decisions. You are portrayed as wanting the power to make decisions. @@ -2420,6 +2517,9 @@ the accused, as you know, is innocent the accused, as I will show, is innocent the accused, as I shall show, is innocent +the accused, as it shall be shown, is innocent +the accused, so it shall be shown, is innocent + % with adverbs the accused, as was widely known, cheated on his wife The accused, as I always suspected, is innocent @@ -2527,6 +2627,39 @@ So far, no one has thought of a solution. % idiom "as is" We bought the table as is. +yes, so I suspect +Just as I suspected! +Much as I suspected! +Just like I suspected! + +it is just like I suspected. +it is much like I suspected. +it is much as I suspected. +it is just as I suspected. + +it is gone, as I suspected +it was gone, as I suspected +it was missing, as I suspected +it was green, as I suspected +it was sandy, as I suspected +he admitted it, as I suspected + +he admitted to it, as I suspected +he admitted to it, as we had feared +he admitted to it, as we had concluded +he confessed to it, as was wanted + +it happens often, as I suspected +it happens commonly, as I suspected +it happens frequently that it breaks, as I'm told + +It seems that it breaks a lot. +it happens that it breaks a lot +it happens that it breaks +it so happens that it breaks +it happens frequently that it breaks +it happens frequently that it is broken +It happens that it breaks a lot % Problems with "go": Let's go shop. @@ -2860,6 +2993,10 @@ You just scrolled past it. What have you gotten into? What have you gotten yourself into? +% prepositional idioms +there were upwards of 100 people there +upwards of 100 people attended + % Questions that want "from", "to" as prep. Where did the car come from? Where do the words come from? @@ -2917,6 +3054,7 @@ Because I have to. Because I want to. But I want to. I wanted to, but I didn't. +He did it, even as he wanted not to I want. Yes, I'd like to. Yes, I'd love to. @@ -3017,6 +3155,11 @@ It is normal that such actions are taken. It is normal that this action is taken. It is normal that this action be taken. +% passive verb expressions +this type of behavior is frowned upon +this type of behavior is looked down on + + % problems with "once" (once as adjective, noun) Once will have to do. You can go just this once. @@ -3118,6 +3261,9 @@ It shoots 12 picosecond pulses. It shoots a 12 picosecond pulse. It is a 12 watt motor. +It has a hardness of 0.34 Brinell units. +It has a tensile toughness of 0.34 joules per cubic metre + It is 1cm away. It is 1mm away. @@ -3225,6 +3371,8 @@ An example would be a 5% NaCl solution. It contains 12 parts alcohol. it contains about 12 liters of ethanol. +We measured 6±2 grams + We spend four dollars per student per year % Lack of space between numbers and letters causes problems @@ -3285,7 +3433,7 @@ The rate is 10 nm per one msec of time. It cost US$ 14 million. It cost $14 million. -% Prepositional modifiers with distances. +% prepositional modifiers with distances. It is 5 miles distant. It was 3 miles under. It was 3 miles east. @@ -3476,7 +3624,10 @@ I say that X plus Y equals Z 2 + 2 = 4 539 + 22 = 561 - +survivors differ from comparisons (5 ± 1 vs. 12 ± 2) +survivors differ from comparisons (mean: 5 ± 1 vs. 12 ± 2 respectively) +survivors differ from comparisons (mean: 5 ± 1 vs. 12 ± 2, respectively) +survivors differ from comparisons (5 vs. 12, respectively) % Ordinals as clause openers first on our list is this item. @@ -3814,8 +3965,15 @@ We ate so-called 'brain food' for lunch. % Institutionalized phrases: % We want the comma to act as a left-wall. By the way, did you have some? +By the way, does he drink? +By the way, what happened? +By the way, when did that happen? +By the way, where did that happen? +By the way, why did that happen? By the way, how was it? Since we are talking about it, how was it? +As we are talking about it, how was it? +Given we are talking about it, how was it? Now that you mention it, what happened? While we're on the topic, was it good? Kenny sure is a bastard. @@ -3872,6 +4030,7 @@ Some days, the trains run on time. Some of the time, I really hate it. The rest of the time, we goof off. part of the year, we goof off. +A lot of the time, it fumes like that. % Opening idioms % some of these have a phantom-that e.g. "I'm telling you that ..." @@ -4005,6 +4164,15 @@ Praise the Lord God, amen! Rock 'n' roll, dude! +% Opinion-exclamations +Sad! +very sad! +Done! +Broken! +Lost! +Ruined! +Ruined! bawled Gambo uncontrollably. + % Given names can be openers to directives or questions. Ma'am, please don't do that. John, please don't do that. @@ -4409,6 +4577,10 @@ Are y'gonna do it? Well, I've been tryin' to esplain it to ya Well, I been tryin' to esplain it to ya +you'd best keep y'mouth shut +think o' how y'gonna answer charges o' unlawful imprisonment an' aggravated assault +think o' how y'gonna answer charges o' drugs runnin' + Well, it just keeps startin' and stoppin' He's gettin' ink done. @@ -4453,6 +4625,8 @@ Christmas Day, well, everybody be so choked up over gifts and everything, they d He does be singing. He does be always drinkin layarge bohhels down be de park boy +% Archaic, poetic British +oh, 'tis love, 'tis love that makes the world go round! % WH-words I do not know why @@ -4596,6 +4770,8 @@ The black and white cat sleeps. It was a long and narrow valley. I don't care if the outcome is good or bad. +We examined the setting (urban vs. rural). + % conjoined adjectives with modifiers The river is wide The river is wide here @@ -4608,6 +4784,9 @@ The river is wide here, and deep, too. Most of the 16th and 17th century leases included husbandry clauses. +she stood there, naked, under the water +she stood there, naked and alone, in the twilight + % comma as a conjunction It tastes bitter, not sweet. It tastes bitter, yet sweet. @@ -4757,6 +4936,19 @@ The new building was started about 1540 on, or very near, the old site. The prize is hidden in or near the playground. The Easter eggs are hidden in and around the house. +% conjoined prepositional phrases with zero-words +inhibition either by chemicals or by hammering did it +inhibition either by chemicals or hammering did it +inhibition by chemicals or hammering did it +inhibition by hammering or chemicals is possible +It is done either with chemicals or hammering +It is done either with hammering or chemicals +It is done either with chemicals or by hammering +AKT inhibition either by chemical inhibitors or small interfering RNAs induced telomere dysfunction + +% conjoined post-nominal verb modifiers +It holds a record of every word, written or spoken + % conjoined adverbs: RJ*v link She handled it quickly and gracefully She handled it skillfully and with compassion @@ -4804,8 +4996,10 @@ The cost and lack of reliability were questioned The lack of reliability and cost were questioned The mounting debt and dearth of solutions have fueled the continuing crisis He wrote for piano and flute. +grip it between thumb and forefinger % conjoined gerunds +% XXX this parses, but not correctly. He enjoyed many rewards, such as free board and lodging at court. @@ -4844,8 +5038,7 @@ let me know about this one and any others these ones and those over there got mashed these and those over there got mashed these both and those over there got mashed -% XXX "these both got mashed" parses, but not correctly. -*these both got mashed +these both got mashed both of those, and this one, got mashed You'll find it at the corner of Gee Ave. and First St. You'll find it at the corner of Gee Ave. and 1st St. @@ -5056,6 +5249,12 @@ I am expecting this sentence to parse correctly, and to yield a very wide diagra I aim to do something and also to help. I aim to do something and to help. I aim to help and also to do something. +I aim to do something and not to complain +I aim to do something and not complain + +% conjoined transitive infinitives +they might supplement or replace anticoagulants +Those findings might help to develop new classes of drugs which may supplement or replace classical anticoagulants and help clinicians to tackle CVD more efficiently. % conjoined verbs with modifiers, negation He cannot change the beliefs of popular society as a whole. @@ -5065,6 +5264,12 @@ He can challenge John, but cannot change the outcome. He can challenge John, but can't change the outcome. He realizes that he and McMurphy can challenge Big Nurse, but cannot change the beliefs of popular society as a whole. +% conjoined verbs with prepostions +... to look at and listen to everything. +he wanted to look at and listen to everything. +Shel Silverstein once said that he wanted to look at and listen to everything. +Shel Silverstein once said that he wanted to go everywhere, look at and listen to everything. + % conjoined verbs in relative clauses This is not the man we know and love. *This is not the man we know and love him @@ -5335,6 +5540,7 @@ I cannot discern any reason, other than some sort of historical blindness, for w John; my advisor, Steve; and several other people are coming No one but she saw the prowler. +% XXX % The two below are valid sentences, but they parse incorrectly just right now % so we will put a * in front of them, for now, till the parse is fixed. *Mike finished in first place, and John in third. @@ -5348,6 +5554,11 @@ The market fell 156.83, or 8%, a week after Black Monday. Mike finished in first place, and John in third. Mike finished in first place, and John in last. +% XXX Conjunctions that parse, but not quite correctly +% We mark them wrong (with a star), for now, until they are fixed. +*Fuck off and have a great day, twit! +*Fuck off and have a great day, jerk! + % -------------------------------------------------------------------- % non-planar graph: "saw" and "yesterday" should link, but don't. % "dog" and "which" do link (and that is correct). @@ -5430,6 +5641,8 @@ She was a girl of almost John's own age, or perhaps older. She was a girl of almost John's age, or maybe older. She was John's age or maybe older +God was active among people of other traditions than my own. + % Broken comparatives: He is nothing less than inspired! He is less than bright! @@ -5462,8 +5675,6 @@ It's the same as the other one. Amen’s hair is same as Ben’s. Amen’s hair is the same as Ben’s. -The coffee tastes as it did last year. - % problems with anticipated/suggested/expected, etc. The defenses have proved more formidable than was anticipated. The defenses have proven more formidable than was expected. @@ -5495,21 +5706,42 @@ I beleive you are right neither this or that one will do % -------------------------------------------------------------------- -% sentences that parse, but not correctly: +% Assorted usages of "as". Some are comparatives, some are +% colloquialisms. +% +% XXX Some of these sentences that parse, but not correctly: % We are going to put *'s in front of them, until they are fixed... % Proper fixes for some of these require links that cross... -% viz they should parse, -*You are as sweet as sugar. +% +% Needed dict changes: +% must-form-a-cycle when MVy, MVz cycles with a new link: +% "The coffee tastes the same as it did last year." +% The new link would connect "same--as" +% +% Replace Z links by CV links.... +% +% Get rid of AM link: so that "as much as" works like +% "as big as" or "as smart as", etc. +% The AFd usage with comparatives is awkward as well. + +The coffee tastes the same as it did last year. +*The coffee tastes as it did last year. +he earns as much as was expected + +You are as sweet as sugar. *The situation is not so bad as you suggest. -*He was so foolish as to lie. -*Ridiculous as it seems, the tale is true. +He was so foolish as to lie. +Ridiculous as it seems, the tale is true. *the hotel is quite comfortable as such establishments go -*I don't know as I can answer your question. -*Fuck off and have a great day, twit! -*Fuck off and have a great day, jerk! +% "as" as synonym for "while" I slipped on the ice as I ran home. +*I am as intelligent as John does + +% "as" as a colloquial form of "that" +I don't know as I can answer your question. +% -------------------------------------------------------------------- % This should parse with the TQ/BT link (see OT page) % but that requires links crossing to head-word, so its screwed. *How many years did it last diff --git a/data/en/missing b/data/en/missing deleted file mode 100644 index f1eafec..0000000 --- a/data/en/missing +++ /dev/null @@ -1,8 +0,0 @@ -elipsis -et al. -intra -nominals -Re: -rock 'n' roll (idiom) -sc. -v/v https://forum.wordreference.com/threads/v-v-laboratory-abbreviation.2194381/ diff --git a/data/en/words/words-medical.v.4.1 b/data/en/words/words-medical.v.4.1 index be1b6a4..21ffbd4 100644 --- a/data/en/words/words-medical.v.4.1 +++ b/data/en/words/words-medical.v.4.1 @@ -2587,7 +2587,6 @@ syllabize.v symbolise.v sympathectomise.v sympathectomize.v -sympathise.v synapse.v synchronise.v synergise.v diff --git a/data/en/words/words-medical.v.4.2 b/data/en/words/words-medical.v.4.2 index e7de545..4f63202 100644 --- a/data/en/words/words-medical.v.4.2 +++ b/data/en/words/words-medical.v.4.2 @@ -2606,7 +2606,6 @@ syllabizes.v symbolises.v sympathectomises.v sympathectomizes.v -sympathises.v synapses.v synchronises.v synergises.v diff --git a/data/en/words/words-medical.v.4.3 b/data/en/words/words-medical.v.4.3 index a3caa4d..3c7b0b9 100644 --- a/data/en/words/words-medical.v.4.3 +++ b/data/en/words/words-medical.v.4.3 @@ -2741,7 +2741,6 @@ syllabized.v-d symbolised.v-d sympathectomised.v-d sympathectomized.v-d -sympathised.v-d synapsed.v-d synchronised.v-d synergised.v-d diff --git a/data/en/words/words-medical.v.4.4 b/data/en/words/words-medical.v.4.4 index 76424f6..df3ca1e 100644 --- a/data/en/words/words-medical.v.4.4 +++ b/data/en/words/words-medical.v.4.4 @@ -2752,7 +2752,6 @@ syllabizing.v symbolising.v sympathectomising.v sympathectomizing.v -sympathising.v synapsing.v synchronising.v synergising.v diff --git a/data/en/words/words-medical.v.4.5 b/data/en/words/words-medical.v.4.5 index 98169ee..88220d7 100644 --- a/data/en/words/words-medical.v.4.5 +++ b/data/en/words/words-medical.v.4.5 @@ -2764,7 +2764,6 @@ syllabizing.g symbolising.g sympathectomising.g sympathectomizing.g -sympathising.g synapsing.g synchronising.g synergising.g diff --git a/data/en/words/words.adj.1-const b/data/en/words/words.adj.1-const index bf0556e..8c879ff 100644 --- a/data/en/words/words.adj.1-const +++ b/data/en/words/words.adj.1-const @@ -4593,6 +4593,7 @@ venial.a venomous.a venous.a ventral.a +ventricular.a verbal.a verbatim.a verbose.a @@ -4795,6 +4796,7 @@ xenophobic.a yearlong.a yearly.a yellowish.a +yellowy.a yogic.a yon.a yonder.a diff --git a/data/en/words/words.adj.1-vowel b/data/en/words/words.adj.1-vowel index 9d4a15a..b2530ab 100644 --- a/data/en/words/words.adj.1-vowel +++ b/data/en/words/words.adj.1-vowel @@ -933,6 +933,7 @@ infallible.a infamous.a infantile.a infectious.a +infelicitous.a inferential.a inferior.a infernal.a @@ -1276,6 +1277,8 @@ optional.a opulent.a oracular.a oral.a +orangish.a +orangy.a oratorical.a orbital.a orbium.a diff --git a/data/en/words/words.adv.1 b/data/en/words/words.adv.1 index 261fd14..9a5b217 100644 --- a/data/en/words/words.adv.1 +++ b/data/en/words/words.adv.1 @@ -471,6 +471,7 @@ favourably fearfully fearlessly feebly +felicitously ferociously fervently fervidly @@ -711,6 +712,7 @@ inexpensively inexplicably inextricably infamously +infelicitously inflexibly informally informatively diff --git a/data/en/words/words.n.1-const b/data/en/words/words.n.1-const index e968e56..13ca882 100644 --- a/data/en/words/words.n.1-const +++ b/data/en/words/words.n.1-const @@ -293,6 +293,7 @@ berry.n berth.n beryl.s bestiary.n +best_man bestowal.s bestseller.n beta.s @@ -469,6 +470,7 @@ boater.n boathouse.n boat.s boatswain.n +bob.n bobby.n bobsled.n bobsleigh.n @@ -684,6 +686,8 @@ broom.n broomstick.n brothel.n brotherhood.s +brother.n +Brother.n brother.n-m brouhaha.n brow.n @@ -931,6 +935,7 @@ cappuccino.s caprice.n capsule.n captain.n +Captain.n caption.n captive.n captor.n @@ -1511,6 +1516,7 @@ comic.n comma.n commandant.n commander.n +Commander.n commandment.n command.n commando.n @@ -1524,6 +1530,7 @@ commissar.n commissary.n commissionaire.n commissioner.n +Commissioner.n commission.s commit.n committee.n @@ -1576,6 +1583,7 @@ compound.s compressor.n compromise.s comptroller.n +Comptroller.n computation.s computer.n comrade.n @@ -1630,6 +1638,7 @@ confessor.n confidante.n confidant.n configuration.n +confine.n confirmation.s conflagration.n conflict.s @@ -1645,6 +1654,7 @@ conglomeration.n congratulation.n congregation.s congressman.n +Congressman.n congress.n conifer.n conjecture.s @@ -1832,6 +1842,7 @@ corpus.n corral.n correction.s corrective.n +correlate.n correlation.n correlative.n correspondence.s @@ -2197,6 +2208,7 @@ dealer.n deal.n deanery.n dean.n +Dean.n dear.n deathbed.n deathblow.n @@ -2328,6 +2340,7 @@ deprival.s deprivation.s depth.s deputy.n +Deputy.n derailment.s derby.n dereference.n @@ -2596,6 +2609,7 @@ dockyard.n docodont.n doctorate.n doctor.n +Doctor.n doctrinaire.n doctrine.s document.n @@ -2751,6 +2765,8 @@ drunkard.n drunk.n dryer.n ducat.n +duchess.n +Duchess.n duchess.n-f duchy.n duckling.n @@ -2766,6 +2782,8 @@ duet.n duffer.n dugout.n dukedom.n +duke.n +Duke.n duke.n-m dulcian.s dulcimer.n @@ -2883,6 +2901,8 @@ fatality.n fate.s fathead.n fatherland.n +father.n +Father.n father.n-m fathom.n faucet.n @@ -3001,6 +3021,7 @@ fink.n fin.n Finn.n fiord.n +fire.n firearm.n fireball.n firebird.n @@ -3015,7 +3036,6 @@ firefly.n firelight.n fireman.n fireplace.n -fire.n fireside.n firework.n firmament.n @@ -3893,6 +3913,7 @@ haven.s haversack.n hawker.n hawk.n +hawser.n hayfork.n haymaker.n haystack.n @@ -3908,7 +3929,9 @@ headlight.n headline.n headlock.n headmaster.n +Headmaster.n headmistress.n +Headmistress.n head.n headquarters.s headrest.n @@ -4335,6 +4358,7 @@ junta.n jurist.n juror.n jury.n +justice.n Justice.n justice.s justification.s @@ -4397,6 +4421,7 @@ kindergarten.n kingdom.n kingfisher.n king.n +King.n kingpin.n kink.n kiosk.n @@ -4423,6 +4448,7 @@ knee.n knife.n knighthood.s knight.n +Knight.n knob.n knocker.n knock.n @@ -4598,6 +4624,7 @@ letterhead.n letter.n lettuce.s leukemia.s +leutenant.n levee.n leveller.n level.n @@ -4844,6 +4871,7 @@ madrigal.n maelstrom.n maestro.n mafia.n +mag.n magazine.s maggot.n magician.n @@ -4859,6 +4887,7 @@ mahogany.s maidenhood.n maiden.n-f maid.n-f +maid_of_honor maidservant.n-f mailbag.n mailboat.s @@ -4872,6 +4901,7 @@ mainstay.n mainstream.n maisonnette.n major.n +Major.n makefile.n maker.n makeshift.n @@ -4968,9 +4998,13 @@ mark.n maroon.n marquee.n marquess.n +marquise.n +Marquise.n marquis.n marriage.s marrowbone.n +marshall.n +Marshall.n marshal.n marshmallow.s marsh.s @@ -4994,8 +5028,12 @@ massacre.n massage.n masseur.n masseuse.n +master-at-arms.n +Master-at-arms.n +Master-at-Arms.n mastermind.n master.n +Master.n masterpiece.n masterstroke.n mastery.s @@ -5396,6 +5434,8 @@ mosquito.n motel.n mothball.n motherland.n +mother.n +Mother.n mother.n-f moth.n motif.n @@ -5879,6 +5919,7 @@ pastime.n past.n pastoral.n pastor.n +Pastor.n pastry.s pasture.s pasty.n @@ -6400,6 +6441,7 @@ poster.n postgraduate.n postmark.n postmaster.n +Postmaster.n postmodifier.n postponement.s postprocessor.n @@ -6483,6 +6525,7 @@ prelim.n prelude.n premiere.n premier.n +Premier.n premiership.n premise.n premiss.n @@ -6532,6 +6575,8 @@ prig.n primacy.s primary.n primate.n +prime_minister +Prime_Minister Prime.n primer.n prime.s @@ -6580,6 +6625,7 @@ professional.n profession.n professoriate.n professor.n +Professor.n professorship.n profile.s profiteer.n @@ -6781,6 +6827,8 @@ quarrel.n quarry.n quarterback.n quarterfinal.n +quarter-master.n +Quarter-master.n quarter.n quartet.n quarto.n @@ -6883,6 +6931,7 @@ rancher.n ranch.s rangefinder.n ranger.n +Ranger.n range.s ranking.n rank.s @@ -7144,9 +7193,9 @@ replication.n reply.n reporter.n repository.n -Represenative.n representation.s representative.n +Representative.n reprieve.n reprimand.n reprint.n @@ -7447,7 +7496,9 @@ sag.n sahib.n sail.n sailor.n +Sainte.n saint.n +Saint.n sake.s salaam.n salad.s @@ -7495,6 +7546,8 @@ sapphire.s sap.s saraband.n sardine.s +sargent.n +Sargent.n sari.n sarong.n sarrusophone.s @@ -7642,6 +7695,7 @@ scrub.n scruff.n scrunch.n scruple.s +scuba.n scud.s scullery.n sculptor.n @@ -7654,6 +7708,7 @@ seafarer.n seafront.n seagull.n seal.n +seaman.n seam.n seamstress.n seance.n @@ -7698,6 +7753,9 @@ segfault.n segmentation.s segment.n segue.n +Seigneur.n +seigneur.n +Seignior.n seignior.n seismograph.n seismologist.n @@ -7835,6 +7893,7 @@ shepherdess.n-f shepherd.n sherbet.s sheriff.n +Sheriff.n sherry.s shibboleth.n shield.n @@ -7994,6 +8053,8 @@ sirloin.s sir.n sirup.s sissy.n-f +sister.n +Sister.n sister.n-f sitar.s sitcom.n @@ -8022,6 +8083,7 @@ skinhead.n skin.s skip.n skipper.n +Skipper.n skirmish.n skirt.n skit.n @@ -8170,11 +8232,13 @@ sofa.n softener.n softie.n soiree.n +sojourn.n sojourner.n solace.s soldier.n sole.n solicitation.n +Solicitor.n solicitor.n solid.n soliloquy.n @@ -8254,6 +8318,7 @@ spasm.n spastic.n spate.n spatula.n +Speaker.n speaker.n speakerphone.n spear.n @@ -8723,6 +8788,7 @@ superfamily.n superficiality.s superfluity.s superintendent.n +Superintendent.n superior.n superlative.n supermarket.n @@ -9328,6 +9394,7 @@ treadle.n treadmill.n tread.n treasurer.n +Treasurer.n treasure.s treasury.n treatise.n @@ -9610,7 +9677,11 @@ vibrator.n vibrato.s vicarage.n vicar.n +vice-admiral.n +Vice-admiral.n +Vice-Admiral.n viceroy.n +Viceroy.n vice.s vicinity.s vicissitude.n @@ -9742,6 +9813,7 @@ wanton.n warble.n warbler.n warden.n +Warden.n warder.n ward.n wardrobe.n diff --git a/data/en/words/words.n.1-vowel b/data/en/words/words.n.1-vowel index 4e4c12e..987b6fd 100644 --- a/data/en/words/words.n.1-vowel +++ b/data/en/words/words.n.1-vowel @@ -1,8 +1,13 @@ abacus.n abbe.n +Abbe.n +abbé.n +Abbé.n abbess.n +Abbess.n abbey.n abbot.n +Abbot.n abbreviation.n abdication.s abdomen.n @@ -271,6 +276,7 @@ amalgamation.s amalgam.n amateur.n ambassador.n +Ambassador.n ambiguity.s ambit.n ambulance.n @@ -447,6 +453,7 @@ archaeologist.n archaism.n archangel.s archbishop.n +Archbishop.n archbishopric.n archdeacon.n archdeaconry.n @@ -755,6 +762,7 @@ emigre.n eminence.s emirate.n emir.n +Emir.n emissary.n emission.s em.n @@ -1259,6 +1267,7 @@ insolvency.s insomniac.n inspection.s inspector.n +Inspector.n inspiration.s installation.s installment.n diff --git a/data/en/words/words.n.2.s b/data/en/words/words.n.2.s index 100cc02..6bcbfc3 100644 --- a/data/en/words/words.n.2.s +++ b/data/en/words/words.n.2.s @@ -1,4 +1,3 @@ - abacuses.n abbes.n abbesses.n @@ -1100,6 +1099,7 @@ boaters.n boathouses.n boats.n boatswains.n +bobs.n bobbies.n bobsleds.n bobsleighs.n @@ -2464,6 +2464,7 @@ corpuses.n corrals.n corrections.n correctives.n +correlates.n correlations.n correlatives.n correspondences.n @@ -4911,12 +4912,15 @@ havens.n haversacks.n hawkers.n hawks.n +hawsers.n hayforks.n haymakers.n haystacks.n hazards.n hazels.n hazes.n +head_boys +head_girls headaches.n headbands.n headdresses.n @@ -9262,6 +9266,7 @@ scrubs.n scruffs.n scrunches.n scruples.n +scubas.n scuds.n sculleries.n sculptors.n @@ -9788,6 +9793,7 @@ sofas.n softeners.n softies.n soirees.n +sojourns.n sojourners.n solaces.n soldiers.n diff --git a/data/en/words/words.n.3-const b/data/en/words/words.n.3-const index e1ed042..497075c 100644 --- a/data/en/words/words.n.3-const +++ b/data/en/words/words.n.3-const @@ -383,6 +383,7 @@ chalumeau.n-u champagne.n-u championship.n-u change.n-u +changes.n-u chaos.n-u character.n-u characterization.n-u @@ -604,6 +605,7 @@ confederation.n-u conferment.n-u confession.n-u confinement.n-u +confines.n-u confirmation.n-u confiscation.n-u conflict.n-u @@ -817,6 +819,7 @@ decimalization.n-u declamation.n-u declassification.n-u declension.n-u +decline.n-u decolonization.n-u decomposition.n-u decompression.n-u @@ -1335,6 +1338,7 @@ fulfilment.n-u fullness.n-u fumigation.n-u fun.n-u +function.n-u functionalism.n-u fundamentalism.n-u fungicide.n-u @@ -1468,6 +1472,7 @@ greatness.n-u greed.n-u greediness.n-u greenery.n-u +greens.n-u grief.n-u grime.n-u grist.n-u @@ -1556,6 +1561,8 @@ hay.n-u hazard.n-u haze.n-u hazel.n-u +head_boy +head_girl headache.n-u headgear.n-u headroom.n-u @@ -1677,6 +1684,7 @@ hydrophobia.n-u hygiene.n-u hype.n-u hyperbole.n-u +hypertension.n-u hypnotism.n-u hypochondria.n-u hypocrisy.n-u @@ -1842,6 +1850,7 @@ linkage.n-u linoleum.n-u lint.n-u lipstick.n-u +liquid.n-u liquidation.n-u liquidizer.n-u liquor.n-u @@ -1909,6 +1918,7 @@ machinery.n-u machismo.n-u mackerel.n-u madness.n-u +mag.n-u magazine.n-u magenta.n-u magic.n-u @@ -3037,6 +3047,7 @@ schooling.n-u schooltime.n-u sciatica.n-u scintillation.n-u +scissors.n-u sclerosis.n-u scone.n-u scope.n-u @@ -3444,6 +3455,7 @@ synchrony.n-u synclavier.n-u syncopation.n-u syndication.n-u +syndrome.n-u syntax.n-u synthesizer.n-u syphilis.n-u @@ -3546,6 +3558,7 @@ thrift.n-u thrombosis.n-u throttle.n-u thrust.n-u +thumb.n-u thunder.n-u thunderclap.n-u thyme.n-u @@ -3781,6 +3794,7 @@ warfare.n-u warmth.n-u warpaint.n-u wartime.n-u +wash.n-u washboard.n-u washing.n-u waste.n-u diff --git a/data/en/words/words.n.t b/data/en/words/words.n.t index 2b0f2cb..cadf305 100644 --- a/data/en/words/words.n.t +++ b/data/en/words/words.n.t @@ -1,5 +1,10 @@ -abbé.t +Abbe.t +abbe.t Abbé.t +abbé.t +Abbess.t +abbess.t +Abbot.t abbot.t accompanist.t accountant.t @@ -9,9 +14,11 @@ adviser.t advisor.t agent.t aide.t +Ambassador.t ambassador.t analyst.t arbitrator.t +Archbishop.t archbishop.t archdeacon.t architect.t @@ -26,9 +33,11 @@ bailiff.t best_man bosun.t broker.t +Brother.t brother.t buyer.t candidate.t +Captain.t captain.t cardinal.t chairman.t @@ -37,10 +46,14 @@ chancellor.t chaplain.t chief.t clerk.t +Commander.t commander.t +Commissioner.t commissioner.t complainant.t +Comptroller.t comptroller.t +Congressman.t congressman.t contractor.t coordinator.t @@ -49,39 +62,57 @@ correspondent.t councillor.t counsellor.t counselor.t +Deaconess.t deaconess.t +Deacon.t deacon.t +Dean.t dean.t defendant.t defender.t delegate.t Democrat.t +Deputy.t deputy.t diplomat.t director.t +Doctor.t doctor.t +Duchess.t duchess.t +Duke.t duke.t economist.t editor.t +emir.t +Emir.t emissary.t emperor.t empress.t engineer.t executive.t executor.t +Father.t father.t foreman.t founder.t +General.t general.t +Governor.t governor.t +Headmaster.t headmaster.t +Headmistress.t headmistress.t head.t +Inspector.t inspector.t intern.t +Justice.t justice.t +King.t king.t +Knight.t knight.t lawyer.t leader.t @@ -90,53 +121,88 @@ librarian.t litigator.t lobbyist.t maid_of_honor +Major.t major.t manager.t +Marquise.t marquise.t +Marshall.t marshall.t +Master-at-Arms.t +Master-at-arms.t master-at-arms.t +Master.t master.t mate.t +Mayor.t mayor.t +Minister.t minister.t +Mother.t mother.t officer.t owner.t partner.t +Pastor.t pastor.t +Postmaster.t postmaster.t +Premier.t premier.t +President.t president.t +Prime_Minister prime_minister private.t +Professor.t professor.t proprietor.t prosecutor.t +Quarter-master.t quarter-master.t +Ranger.t ranger.t +Representative.t representative.t Republican.t Sainte.t Saint.t +Sargent.t sargent.t seaman.t secretary.t Seigneur.t +seigneur.t +Seignior.t +seignior.t senator.t Senator.t +Shah.t shah.t +Sheriff.t sheriff.t +Sister.t sister.t +Skipper.t skipper.t +Solicitor.t solicitor.t +Speaker.t speaker.t spokesman.t spokesperson.t spokeswoman.t sponsor.t +Superintendent.t superintendent.t +Treasurer.t treasurer.t undersecretary.t underwriter.t +Vice-Admiral.t +Vice-admiral.t vice-admiral.t +Viceroy.t +viceroy.t +Warden.t warden.t diff --git a/data/en/words/words.v.1.1 b/data/en/words/words.v.1.1 index 7ea662e..7b970e1 100644 --- a/data/en/words/words.v.1.1 +++ b/data/en/words/words.v.1.1 @@ -58,7 +58,6 @@ barf.v bark.v barnstorm.v bask.v -bawl.v bay.v beep.v beetle.v @@ -916,6 +915,7 @@ swelter.v swerve.v swirl.v swoon.v +sympathise.v sympathize.v tamper.v tap-dance.v diff --git a/data/en/words/words.v.1.2 b/data/en/words/words.v.1.2 index a0f0704..b44d782 100644 --- a/data/en/words/words.v.1.2 +++ b/data/en/words/words.v.1.2 @@ -57,7 +57,6 @@ barfs.v barks.v barnstorms.v basks.v -bawls.v bays.v beeps.v beetles.v @@ -922,6 +921,7 @@ swelters.v swerves.v swirls.v swoons.v +sympathises.v sympathizes.v tampers.v tap-dances.v diff --git a/data/en/words/words.v.1.3 b/data/en/words/words.v.1.3 index 354eb9b..da9d55c 100644 --- a/data/en/words/words.v.1.3 +++ b/data/en/words/words.v.1.3 @@ -57,7 +57,6 @@ barfed.v-d barked.v-d barnstormed.v-d basked.v-d -bawled.v-d bayed.v-d beeped.v-d beetled.v-d @@ -926,6 +925,7 @@ sweltered.v-d swerved.v-d swirled.v-d swooned.v-d +sympathised.v-d sympathized.v-d tampered.v-d tap-danced.v-d diff --git a/data/en/words/words.v.1.4 b/data/en/words/words.v.1.4 index d6637d5..2c05e05 100644 --- a/data/en/words/words.v.1.4 +++ b/data/en/words/words.v.1.4 @@ -53,7 +53,6 @@ banting.v barfing.v barking.v basking.v -bawling.v baying.v beeping.v beetling.v @@ -898,6 +897,7 @@ sweltering.v swerving.v swirling.v swooning.v +sympathising.v sympathizing.v tampering.v tap-dancing.v diff --git a/data/en/words/words.v.1.p b/data/en/words/words.v.1.p index 19e7ef3..0dcef94 100644 --- a/data/en/words/words.v.1.p +++ b/data/en/words/words.v.1.p @@ -31,6 +31,7 @@ embarked_on entered_into fought_with frowned_on +frowned_upon gazed_upon glared_at gossiped_about @@ -46,6 +47,7 @@ listened_to lived_in longed_for looked_at +looked_down_on monkeyed_with negotiated_with objected_to diff --git a/data/en/words/words.v.10.1 b/data/en/words/words.v.10.1 index 96b8f3d..35a665d 100644 --- a/data/en/words/words.v.10.1 +++ b/data/en/words/words.v.10.1 @@ -11,6 +11,7 @@ ascertain.q assert.q assume.q aver.q +bawl.q believe.q blather.q bloviate.q @@ -27,6 +28,7 @@ confess.q confirm.q contend.q continue.q +croak.q cry.q decide.q declare.q @@ -38,11 +40,13 @@ disclose.q discover.q dodge.q emphasize.q +entreat.q envision.q equivocate.q evade.q exclaim.q explain.q +fear.q figure.q guess.q hedge.q @@ -76,10 +80,14 @@ prevaricate.q proclaim.q profess.q promise.q +pronounce.q propose.q prove.q +query.q +question.q quiver.q realize.q +rant.q reason.q recall.q reckon.q @@ -97,19 +105,28 @@ respond.q retort.q reveal.q rule.q +rumble.q scream.q shout.q sigh.q sing.q +snort.q sob.q +speak.q speculate.q spit.q +squawk.q +squeak.q +squeal.q stall.q +stammer.q state.q stipulate.q stress.q suggest.q +suspect.q swear.q +swoon.q temporize.q tergiversate.q testify.q @@ -120,6 +137,7 @@ urge.q utter.q vacillate.q vocalize.q +warble.q warn.q waver.q whisper.q diff --git a/data/en/words/words.v.10.2 b/data/en/words/words.v.10.2 index 11c03d0..00a9cff 100644 --- a/data/en/words/words.v.10.2 +++ b/data/en/words/words.v.10.2 @@ -11,6 +11,7 @@ ascertains.q asserts.q assumes.q avers.q +bawls.q believes.q blathers.q bloviates.q @@ -28,6 +29,7 @@ confirms.q contends.q continues.q cries.q +croaks.q decides.q declares.q deduces.q @@ -38,11 +40,13 @@ discloses.q discovers.q dodges.q emphasizes.q +entreats.q envisions.q equivocates.q evades.q exclaims.q explains.q +fears.q figures.q guesses.q hedges.q @@ -75,9 +79,13 @@ presupposes.q prevaricates.q proclaims.q professes.q +pronounces.q proposes.q proves.q +queries.q +questions.q quivers.q +rants.q reads.q realizes.q reasons.q @@ -97,19 +105,28 @@ responds.q retorts.q reveals.q rules.q +rumbles.q screams.q shouts.q sighs.q sings.q +snorts.q sobs.q +speaks.q speculates.q spits.q +squawks.q +squeaks.q +squeals.q stalls.q +stammers.q states.q stipulates.q stresses.q suggests.q +suspects.q swears.q +swoons.q temporizes.q tergiversates.q testifies.q @@ -120,6 +137,7 @@ urges.q utters.q vacillates.q vocalizes.q +warbles.q warns.q wavers.q whispers.q diff --git a/data/en/words/words.v.10.3 b/data/en/words/words.v.10.3 index 90ba638..a28658a 100644 --- a/data/en/words/words.v.10.3 +++ b/data/en/words/words.v.10.3 @@ -11,6 +11,7 @@ ascertained.q-d asserted.q-d assumed.q-d avered.q-d +bawled.q-d believed.q-d blathered.q-d bloviated.q-d @@ -28,6 +29,7 @@ confirmed.q-d contended.q-d continued.q-d cried.q-d +croaked.q-d decided.q-d declared.q-d deduced.q-d @@ -38,11 +40,13 @@ disclosed.q-d discovered.q-d dodged.q-d emphasized.q-d +entreated.q-d envisioned.q-d equivocated.q-d evaded.q-d exclaimed.q-d explained.q-d +feared.q-d figured.q-d guessed.q-d hedged.q-d @@ -75,9 +79,13 @@ presupposed.q-d prevaricated.q-d proclaimed.q-d professed.q-d +pronounced.q-d proposed.q-d proved.q-d +queried.q-d +questioned.q-d quivered.q-d +ranted.q-d realized.q-d reasoned.q-d recalled.q-d @@ -96,18 +104,28 @@ responded.q-d retorted.q-d revealed.q-d ruled.q-d +rumbled.q-d sang.q-d screamed.q-d shouted.q-d sighed.q-d +snorted.q-d sobbed.q-d +spake.q-d speculated.q-d spit.q-d +spoke.q-d +squawked.q-d +squeaked.q-d +squealed.q-d stalled.q-d +stammerd.q-d stated.q-d stipulated.q-d stressed.q-d suggested.q-d +suspected.q-d +swooned.q-d swore.q-d temporized.q-d tergiversated.q-d @@ -119,6 +137,7 @@ urged.q-d uttered.q-d vacillated.q-d vocalized.q-d +warbled.q-d wavered.q-d whispered.q-d wondered.q-d diff --git a/data/en/words/words.v.10.4 b/data/en/words/words.v.10.4 index 4fa8e68..d13e68c 100644 --- a/data/en/words/words.v.10.4 +++ b/data/en/words/words.v.10.4 @@ -11,6 +11,7 @@ ascertaining.q asserting.q assuming.q avering.q +bawling.q believing.q blathering.q bloviating.q @@ -27,6 +28,7 @@ confessing.q confirming.q contending.q continuing.q +croaking.q-d crying.q deciding.q declaring.q @@ -38,11 +40,13 @@ disclosing.q discovering.q dodging.q emphasizing.q +entreating.q envisioning.q equivocating.q evading.q exclaiming.q explaining.q +fearing.q figuring.q guessing.q hedging.q @@ -75,9 +79,13 @@ presupposing.q prevaricating.q proclaiming.q professing.q +pronouncing.q proposing.q proving.q +querying.q +questioning.q quivering.q +ranting.q reading.q realizing.q reasoning.q @@ -97,19 +105,28 @@ responding.q retorting.q revealing.q ruling.q +rumbling.q screaming.q shouting.q sighing.q singing.q +snorting.q sobing.q +speaking.q speculating.q spiting.q +squawkig.q +squeaking.q +squealing.q stalling.q +stammering.q stating.q stipulating.q stressing.q suggesting.q +suspecting.q swearing.q +swooning.q temporizing.q tergiversating.q testifying.q @@ -120,6 +137,7 @@ urging.q uttering.q vacillating.q vocalizing.q +warbling.q warning.q wavering.q whispering.q diff --git a/data/en/words/words.v.2.1 b/data/en/words/words.v.2.1 index 4826b1f..2702d52 100644 --- a/data/en/words/words.v.2.1 +++ b/data/en/words/words.v.2.1 @@ -1172,7 +1172,6 @@ stabilize.v stablize.v stain.v stall.v -stammer.v stampede.v steady.v steepen.v diff --git a/data/en/words/words.v.2.2 b/data/en/words/words.v.2.2 index 6c1591b..c0cf5bd 100644 --- a/data/en/words/words.v.2.2 +++ b/data/en/words/words.v.2.2 @@ -1217,7 +1217,6 @@ stabilizes.v stablizes.v stains.v stalls.v -stammers.v stampedes.v steadies.v steepens.v diff --git a/data/en/words/words.v.2.3 b/data/en/words/words.v.2.3 index 653ddf3..11dffe7 100644 --- a/data/en/words/words.v.2.3 +++ b/data/en/words/words.v.2.3 @@ -1194,7 +1194,6 @@ stabilized.v-d stablized.v-d stained.v-d stalled.v-d -stammered.v-d stampeded.v-d steadied.v-d steeped.v-d diff --git a/data/en/words/words.v.2.4 b/data/en/words/words.v.2.4 index af12ff5..9de7695 100644 --- a/data/en/words/words.v.2.4 +++ b/data/en/words/words.v.2.4 @@ -1196,7 +1196,6 @@ stabilizing.v stablizing.v staining.v stalling.v -stammering.v stampeding.v steadying.v steepening.v diff --git a/data/en/words/words.v.2.5 b/data/en/words/words.v.2.5 index 099b0de..9862a51 100644 --- a/data/en/words/words.v.2.5 +++ b/data/en/words/words.v.2.5 @@ -1197,7 +1197,6 @@ stabilizing.g stablizing.g staining.g stalling.g -stammering.g stampeding.g steadying.g steepening.g diff --git a/data/en/words/words.v.4.1 b/data/en/words/words.v.4.1 index a1acb15..635aea5 100644 --- a/data/en/words/words.v.4.1 +++ b/data/en/words/words.v.4.1 @@ -1448,6 +1448,7 @@ obtain.v obviate.v occasion.v occupy.v +off.v offend.v offload.v oil.v @@ -2156,7 +2157,6 @@ splatter.v sponsor.v spoonfeed.v spotlight.v -spot.v sprain.v spray.v sprinkle.v diff --git a/data/en/words/words.v.4.2 b/data/en/words/words.v.4.2 index 0320006..a22b1b8 100644 --- a/data/en/words/words.v.4.2 +++ b/data/en/words/words.v.4.2 @@ -1455,6 +1455,7 @@ obtains.v obviates.v occasions.v occupies.v +offs.v offends.v offloads.v oils.v @@ -2167,7 +2168,6 @@ splatters.v sponsors.v spoonfeeds.v spotlights.v -spots.v sprains.v sprays.v sprinkles.v diff --git a/data/en/words/words.v.4.3 b/data/en/words/words.v.4.3 index 738653a..7075f25 100644 --- a/data/en/words/words.v.4.3 +++ b/data/en/words/words.v.4.3 @@ -1435,6 +1435,7 @@ obtained.v-d obviated.v-d occasioned.v-d occupied.v-d +offed.v-d offended.v-d offloaded.v-d oiled.v-d @@ -2135,7 +2136,6 @@ splattered.v-d sponsored.v-d spoonfed.v-d spotlighted.v-d -spotted.v-d sprained.v-d sprayed.v-d sprinkled.v-d diff --git a/data/en/words/words.v.4.4 b/data/en/words/words.v.4.4 index 0fe3714..a75be23 100644 --- a/data/en/words/words.v.4.4 +++ b/data/en/words/words.v.4.4 @@ -1447,6 +1447,7 @@ obtaining.v obviating.v occasioning.v occupying.v +offing.v offending.v offloading.v oiling.v @@ -2162,7 +2163,6 @@ splattering.v sponsoring.v spoonfeeding.v spotlighting.v -spotting.v spraining.v spraying.v sprinkling.v diff --git a/data/en/words/words.v.4.5 b/data/en/words/words.v.4.5 index 2356a25..5b9319a 100644 --- a/data/en/words/words.v.4.5 +++ b/data/en/words/words.v.4.5 @@ -1448,6 +1448,7 @@ obtaining.g obviating.g occasioning.g occupying.g +offing.g offending.g offloading.g oiling.g @@ -2163,7 +2164,6 @@ splattering.g sponsoring.g spoonfeeding.g spotlighting.g -spotting.g spraining.g spraying.g sprinkling.g diff --git a/data/en/words/words.v.8.1 b/data/en/words/words.v.8.1 index 9ee2342..e4a4ced 100644 --- a/data/en/words/words.v.8.1 +++ b/data/en/words/words.v.8.1 @@ -107,6 +107,7 @@ track.v wad.v wash.v wear.v +wick.v wring.v yank.v zip.v diff --git a/data/en/words/words.v.8.2 b/data/en/words/words.v.8.2 index 9b44a09..49a807f 100644 --- a/data/en/words/words.v.8.2 +++ b/data/en/words/words.v.8.2 @@ -108,6 +108,7 @@ tracks.v wads.v washes.v wears.v +wicks.v wrings.v yanks.v zips.v diff --git a/data/en/words/words.v.8.3 b/data/en/words/words.v.8.3 index 7adc06a..66c8b0f 100644 --- a/data/en/words/words.v.8.3 +++ b/data/en/words/words.v.8.3 @@ -108,6 +108,7 @@ toughened.v-d tracked.v-d wadded.v-d washed.v-d +wicked.v-d wrung.v-d yanked.v-d zipped.v-d diff --git a/data/en/words/words.v.8.4 b/data/en/words/words.v.8.4 index 4a4655b..332b09f 100644 --- a/data/en/words/words.v.8.4 +++ b/data/en/words/words.v.8.4 @@ -109,6 +109,7 @@ tying.v wadding.v washing.v wearing.v +wicking.v wringing.v yanking.v zipping.v diff --git a/data/en/words/words.v.8.5 b/data/en/words/words.v.8.5 index ac991fe..784c030 100644 --- a/data/en/words/words.v.8.5 +++ b/data/en/words/words.v.8.5 @@ -109,6 +109,7 @@ tying.g wadding.g washing.g wearing.g +wicking.g wringing.g yanking.g zipping.g diff --git a/data/fa/README b/data/fa/README index b63dc53..cf8e394 100644 --- a/data/fa/README +++ b/data/fa/README @@ -43,3 +43,6 @@ example usage is: or, equivalently: echo -e 'man midAnam keh tu rafti.\n' | ./stemmer.pl -u | link-parser fa + +See also: +https://github.com/jonsafari/perstem diff --git a/data/he/4.0.dict.m4 b/data/he/4.0.dict.m4 new file mode 100644 index 0000000..da0cf81 --- /dev/null +++ b/data/he/4.0.dict.m4 @@ -0,0 +1,461 @@ +dnl +dnl Macro version of the 4.0.dict file. +dnl +dnl The comment delimiter for link-grammar data files is % +changecom(`%')dnl + %***************************************************************************% + % % + % Experimental prototype Hebrew dictionary % + % Copyright (C) 2014 Amir Plivatsky % + % % + % Based on en/tiny.dict, % + % Copyright (C) 1991-1998 Daniel Sleator and Davy Temperley % + % + % and on en/4.0.dict.m4, + % Copyright (C) 1991-1998 Daniel Sleator and Davy Temperley % + % Copyright (c) 2003 Peter Szolovits and MIT. % + % Copyright (c) 2008-2014 Linas Vepstas % + % Copyright (c) 2013 Lian Ruiting % + % % + % See file "LICENSE" for information about commercial use of this system % + % % + %***************************************************************************% + +% Demo Hebrew dictionary, for initial checks. [ap] +% +% Its origin is the English tiny.dict, in which I translated some words +% and added a few more, for the purpose of checking: +% - tokenizing, including multi-prefix split +% - the resolver behavior with multi-prefix linkages +% - result printing +% The old English definitions are commented out by %#. +% +% Some of the definitions have been replaced by the corresponding ones from +% the full English dictionary (en/4.0.dict.m4). They were partially +% converted to handle Hebrew. +% +% Much of the grammar here is still the English one, +% so it is incorrect for Hebrew. +% +% By now several changes have been done to handle Hebrew more correctly. +% Subject/verb/adjective, gender, and single/plural etc. agreements are only +% partially done. Most of the Hebrew grammatical constructs are not supported +% here. +% +% Among numerous other things, changes to handle count/uncountable changes +% have not been done yet. The created infrastructure for that may still need changes. + +% Dictionary version number is 5.3.15 (formatted as V5v3v15+) +: V5v3v15+; +: HE4il+; + +% For now. +LEFT-WALL: {Wa+} or {Wd+} or (); + +% The costly-null is introduced here for now, so expressions can be copied from +% the English dictionary as they are. +: [[[[()]]]]; + +% NOUNS +% Initially copied from the English dictionary, most probably along with unneeded +% and inappropriate links for Hebrew (to be changed later). + +% Hebrew S links: +% S1234 +% 1: s, p - for singular, plural +% 2: c, u - for count, uncountable +% 3: m, f - gender: male, female +% 4: 1, 2, 3 - for 1st, 2nd, 3rd person + +% The RJ links connect to "and"; the l,r prevent cross-linking +: RJrc- or RJlc+; + +% {@COd-} : "That is the man who, in Joe's opinion, we should hire" +: {({@COd-} & (C- or )) or ({@CO-} & (Wd- & {CC+})) or [Rn-]}; +: {({@COd-} & (C- or )) or ({@CO-} & (Wd- & {CC+}))}; +: {({@COd-} & (C- or )) or ({@CO-} & (Wd- or {CC+})) or Re-}; + +% Post-nominal qualifiers, complete with commas, etc. +: + ({[B*j+]} & Xd- & (Xc+ or ) & MX-); + +: + ({[Bsj+]} & Xd- & (Xc+ or ) & MX-); + +: + ({[Bpj+]} & Xd- & (Xc+ or ) & MX-); + +: + ({[Buj+]} & Xd- & (Xc+ or ) & MX-); + +define(`NOUN_MAIN',`' + (((S$1$2$3$4+ or P+) & ) or SIs- or Js- or O$1*$3- + or + or )) + +: NOUN_MAIN(s,c,m,3); +: NOUN_MAIN(s,u,m,3); +: NOUN_MAIN(s,c,f,3); +: NOUN_MAIN(s,u,f,3); +: NOUN_MAIN(p,c,m,3); +: NOUN_MAIN(p,u,m,3); +: NOUN_MAIN(p,c,f,3); +: NOUN_MAIN(p,u,f,3); + +% NOUN_MAIN_H() arguments: +% 1: s, p - for singular, plural +% 2: m, f - gender: male, female + +% Dmu -> D*u ??? for now +define(`NOUN_MAIN_H', + ((Jd- & D*u- & O$1-) + or (Jd- & D*u- & {Wd-} & S$1*$2*b+) + or ((S$1*$2*b+ or O$1*$2+) & ) or SI$1*$2*b- or [[J$1*$2-]] or [O$1*$2-] + or + or )) + +: {@M+} & {((R+ & B+) or (Ds- & Rb+)) & {[[@M+]]}} & {@MX+}; +: {@M+} & {((R+ & Bs+) or (Ds- & Rb+)) & {[[@M+]]}} & {@MXs+}; +: {@M+} & {((R+ & Bp+) or (Ds- & Rb+)) & {[[@M+]]}} & {@MXp+}; + +% Ds- here disallows *הכלב שחור רץ +: + ((@A+ or Ds-) & {[[@AN-]]}) + or [@AN-]0.1 + or ([[@AN-].1 & @A+] & {[[@AN-]]}) + or (); + +: {Rw+} & B*m+; +: {Rw+} & Bsm+; +: {Rw+} & Bpm+; + +: ({@M+} & SJls+) or ({[@M+]} & SJrs-); +: ({[@M+]} & SJlp+) or ({[[@M+]]} & SJrp-); +: ({[@M+]} & SJlu+) or ({[[@M+]]} & SJru-); +: ({[@M+]} & SJl+) or ({[[@M+]]} & SJr-); + +define(`COMMON_NOUN', + ( & + (({NMa+} & AN+) + or ((NM+ or ({[NM+]1.5} )) % & Ds- moved to noun-modifiers + & (( & (NOUN_MAIN($1,$2,$3,$4) or )) + or )) + or SJrs- + or (YS+ & Ds-) + or (GN+ & (DD- or [()])) + or Us- + or ({Ds-} & Wa-)))) + +%#dog cat woman man park yard bone neighbor store street bird hammer nose +%#party friend house movie brother sister diner student exam: +%# {@A-} & Ds- & {@M+ or (R+ & Bs+)} & +%# (J- or Os- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-); +כלב חתול איש פארק שכן רחוב פטיש אף +חבר בית סרט אח סטודנט מבחן ניסוי לב ורד שולחן: +%% ({@A+} or {Ds-}) & {@M+ or (R+ & Bs+) or (Ds- & Rb+)} & +%% (J- or Os- or ((Ss+ or P+) & (({@CO-} & {C-}) or R-)) or SIs-); +COMMON_NOUN(s,c,m,3); + +כלבה חתולה אישה חצר עצם שכנה חנות ציפור +מסיבה חברה אחות ארוחה סטודנטית: +COMMON_NOUN(s,c,f,3); + +%#dogs cats women men +%#parks yards bones neighbors stores streets birds hammers noses +%#parties friends houses movies brothers sisters diners students exams +%#wars winters actions laws successes: +%#{@A+} & {Dmc-} & {@M+ or (R+ & Bp+)} & +%# (J- or Op- or (Sp+ & (({@CO-} & {C-}) or R-)) or SIp-); +כלבים חתולים גברים פארקים שכנים רחובות פטישים אפים +חברים בתים סרטים אחים סטודנטים מבחנים שולחנות: +%%{@A+} & {Dmc-} & {@M+ or (R+ & Bp+)} & +%% (J- or Op- or (Sp+ & (({@CO-} & Wd- & {C-}) or R-)) or SIp-); +COMMON_NOUN(p,c,m,3); + +כלבות חתולות נשים חצרות עצמות שכנות חנויות ציפורים +מסיבות חברות אחיות ארוחות סטודנטיות: +COMMON_NOUN(p,c,f,3); + +%#water anger money politics trouble: +%#{@A+} & {Dmu-} & {@M+ or (R+ & Bs+)} & +%#(J- or Os- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-); +מים כעס כסף פוליטיקה: +{@A+} & {Dmu-} & {@M+ or (R+ & Bs+)} & +(J- or Os- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-); + +%#law winter action war success: +%#{@A+} & {D*u-} & {@M+ or (R+ & Bs+)} & +%#(J- or Os- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-); +חוק חורף פעולה מלחמה הצלחה: +{@A+} & {D*u-} & {@M+ or (R+ & Bs+)} & +(J- or Os- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-); + +%PRONOUNS + +% 1: s, p - for singular, plural +% 2: m, f - gender: male, female +% 3: 1, 2, 3 - for 1st, 2nd, 3rd person +define(`PERSONAL_PRONOUN_S', + ({{[[R+ & B$1*$2$3+]]} & + (J- or O$1*$2$3- or ({S$1*$2$3+} & ) or SI$1*$2$3- or SJl$1*$2$3+)} +% Need to update + & {(({S$1*$2$3-} or (RS- & B$1*$2$3-) or ({Q-} & SI$1*$2$3+)) + & (((O$1*$2$3+ or B-) & {@MV+}) or P+ or AF-))}) +) +%#she he: (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-; +%#me him them us: J- or O-; +אותי אותו אותה אותם אותנו: J- or O-; +%#her: D+ or J- or O-; +%#its my your their our: D+; +%#his: D+; +שלה שלו שלי שלך שלהם שלנו: Mp-; + + +% May need a J- variant in order to invalidate "של הוא", etc. +%#you they we I: J- or O- or (Sp+ & (({@CO-} & {C-}) or R-)) or SIp-; +%% אתם אתן הם הן אנחנו אני: J- or O- or (Sp+ & (({@CO-} & Wd- & {C-}) or R-)) or SIp-; +%% היא הוא: {J- or O- or ({Ss+} & (({@CO-} & {Wd-} & {C-}) or R-)) or SIs-} +%%% היא הוא: {{[[R+ & Bs+]]} & (({Ss+} & ) or SIs- or SJls+)} +% From "is" - need to update them from the English dict. +%%% & {(({Ss-} or (RS- & Bs-) or ({Q-} & SIs+)) +%%% & (((O+ or B-) & {@MV+}) or P+ or AF-))}; + +אני: PERSONAL_PRONOUN_S(s,*,1); +אתה: PERSONAL_PRONOUN_S(s,m,2); +את: PERSONAL_PRONOUN_S(s,f,2); +הוא: PERSONAL_PRONOUN_S(s,m,3); +היא: PERSONAL_PRONOUN_S(s,f,3); +אנחנו אנו: PERSONAL_PRONOUN_S(p,*,3); +אתם: PERSONAL_PRONOUN_S(p,m,2); +אתן: PERSONAL_PRONOUN_S(p,f,2); +הם: PERSONAL_PRONOUN_S(p,m,3); +הן: PERSONAL_PRONOUN_S(p,f,3); + +%#this: (J- or O- or (Ss+ & (({@CO-} & {C-}) or R-)) or SIs-) or D*u+; +%%זה: (J- or O- or ((Ss+ or Os+) & (({@CO-} & Wd- & {C-}) or R-)) or SIs-) or D*u+; +זה: + NOUN_MAIN_H(s,m) + or EA- + or ; + +זו: + NOUN_MAIN_H(s,f) + or EA- + or ; + +%#these: (J- or O- or (Sp+ & (({@CO-} & {C-}) or R-)) or SIp-) or Dmc+; +%#those: (Dmc+) or (({P+} or {{C+} & Bp+}) & +%#(J- or O- or (Sp+ & (({@CO-} & {C-}) or R-)) or SIp- or Xb-)); +%%אלו: (J- or O- or (Sp+ & (({@CO-} & Wd- & {C-}) or R-)) or SIp-) or Dmc+; +אלו אלה: + NOUN_MAIN_H(p,*) + or EA- + or ; + +% Demonstrative determiner only - needs a total fix +%%הללו: (Dmc+) or (({P+} or {{C+} & Bp+}) & +%%(J- or O- or (Sp+ & (({@CO-} & {C-}) or R-)) or SIp- or Xb-)); + +%--- + +%#the: D+; +% Need both R and B to nouns (to allow the second ה=: הכלב השחור רץ) +% hence invented here Rb +ה=: D+ or (Rb- & P+); +%#a: Ds+; + +%#did: ({Q-} & SI+ & I+) or ({@E-} & (S- or +%#(RS- & B-)) & (((B- or O+) & {@MV+}) or I+)); +%#do: (SIp+ & I+) or ({@E-} & (Sp- or +%#(RS- & Bp-) or I-) & +%#(((B- or O+) & {@MV+}) or I+)); +%#does: ({Q-} & SIs+ & I+) or ({@E-} & (Ss- or (RS- & Bs-)) & +%#(((B- or O+) & {@MV+}) or I+)); +%#done: {@E-} & (Pv- or M- or (PP- & (B- or O+) & {@MV+})); +%#doing: {@E-} & (Pg- or Mg-) & (O+ or B-) & {@MV+}; + +%#has: ({Q-} & SIs+ & PP+) or ({@E-} & (Ss- or (RS- & B-)) & +%#(TO+ or ((B- or O+) & {@MV+}) or PP+)); +%#have: ({Q-} & SIp+ & PP+) or ({@E-} & (Sp- or +%#(RS- & Bp-) or I-) & +%#(TO+ or ((B- or O+) & {@MV+}))); +%#had: ({Q-} & SI+ & PP+) or ({@E-} & (S- or (RS- & B-) or PP-) & +%#(TO+ or ((B- or O+) & {@MV+}) or PP+)); +%#having: {@E-} & (M- or Pg-) & (TO+ or ((B- or O+) & {@MV+}) or PP+); + +%#is was: ((Ss- or (RS- & Bs-) or ({Q-} & SIs+)) +%# & (((O+ or B-) & {@MV+}) or P+ or AF-)); +הנו היה: ((Ss- or (RS- & Bs-) or ({Q-} & SIs+)) + & (((O+ or B-) & {@MV+}) or P+ or AF-)); +%#are were am: ((Sp- or (RS- & Bp-) or ({Q-} & +%#SIp+)) & (((O+ or B-) & {@MV+}) or P+ or AF-)); +הנם היו הנני: ((Sp- or (RS- & Bp-) or ({Q-} & +SIp+)) & (((O+ or B-) & {@MV+}) or P+ or AF-)); +%#be: I- & (((O+ or B-) & {@MV+}) or P+ or AF-); +%#been: PP- & (((O+ or B-) & {@MV+}) or P+ or AF-); +%#being: {@E-} & (M- or Pg-) & (((O+ or B-) & {@MV+}) or P+ or AF-); + +%#will can.v may must could should would might: (({Q-} & +%#SI+) or S- or (RS- & B-)) & I+; + +%VERBS + +: Xd- & (Xc+ or ) & (MX*p- or MVg-); +: {Xd-} & Xc+ & COp+; + +% These are the verb-form expressions for ordinary verbs. + +% : these connect to the head verb: +% WV connects the wall to the head-verb, +% CV connects the dominating clause to the head verb of the dependent clause. +% IV connects infinitives to the head-verb +%: dWV- or dCV- or dIV- or [[()]]; +: (); % Not implemented for now for Hebrew + +% VERB() arguments: +% 1: s, p - for singular, plural +% 2: m, f - gender: male, female +% 3: 1, 2, 3 - for 1st, 2nd, 3rd person + +define(`VERB', + ({@E-} & (((S$1*$2$3- & ) or (RS- & B$1*$2$3-)) & {@MV+}))) + +%#run come: {@E-} & (Sp- or (RS- & Bp-) or I- or W- or PP-) & {@MV+}; +%%רצים באים הולכים: {@E-} & (Sp- or (RS- & Bp-) or I- or W- or PP-) & {@MV+}; +רצים באים הולכים זזים: VERB(p,m,3); +רצות באות הולכות זזות: VERB(p,f,3); +%#runs comes goes: {@E-} & (Ss- or (RS- & Bs-)) & {@MV+}; +%%רץ רצה בא באה הולך: {@E-} & (Ss- or (RS- & Bs-)) & {@MV+}; +רץ בא הולך זז: VERB(s,m,3); +רצה באה הולכת זזה: VERB(s,f,3); +%%זז: {@E-} & (Ss*m3- or (RS- & Bs*m3-)) & {@MV+}; +%#ran came went: {@E-} & (S- or (RS- & B-)) & {@MV+}; +%#go: {@E-} & (Sp- or (RS- & Bp-) or I-) & {@MV+}; +%#gone: {@E-} & PP- & {@MV+}; +%#going: {@E-} & (Pg- or M-) & {TO+} & {@MV+}; +%#running coming: {@E-} & (Pg- or M-) & {@MV+}; + +%#talk arrive die: +%# {@E-} & (Sp- or (RS- & Bp-) or I-) & {@MV+}; +מדבר מגיע מת: + {@E-} & (Sp- or (RS- & Bp-) or I-) & {@MV+}; +%#talks.v arrives dies: +%# {@E-} & (Ss- or (RS- & Bs-)) & {@MV+}; +%#talked arrived died: +%# {@E-} & (S- or (RS- & B-) or PP-) & {@MV+}; +%#talking arriving dying: +%# {@E-} & (Pg- or M-) & {@MV+}; + +%#see meet chase invite arrest: +%# {@E-} & (Sp- or (RS- & Bp-) or I-) & (O+ or B-) & {@MV+}; +%#sees meets chases invites arrests: +%# {@E-} & (Ss- or (RS- & Bs-)) & (O+ or B-) & {@MV+}; +%#met chased invited arrested: +%#{@E-} & (M- or Pv- or ((S- or (RS- & B-) or PP-) & (B- or O+))) & {@MV+}; +פגש רדף הזמין אסר: +{@E-} & (M- or Pv- or ((S- or (RS- & B-) or PP-) & (B- or O+))) & {@MV+}; +%#saw: {@E-} & (S- or (RS- & B-)) & (B- or O+) & {@MV+}; +%#seen: {@E-} & (Pv- or M- or (PP- & (B- or O+))) & {@MV+}; +%#seeing meeting chasing inviting arresting: +%#{@E-} & (Pg- or M-) & (O+ or B-) & {@MV+}; + +%#tell: {@E-} & (Sp- or (RS- & Bp-) or I-) & ((O+ or B-) & +%#{TH+ or C+ or QI+ or @MV+}); +מספרים: {@E-} & (Sp- or (RS- & Bp-) or I-) & ((O+ or B-) & +{TH+ or C+ or QI+ or @MV+}); +%#tells: {@E-} & (Ss- or (RS- & Bs-)) & ((O+ or B-) & {TH+ or C+ +%#or QI+ or @MV+}); +מספר: {@E-} & (Ss- or (RS- & Bs-)) & ((O+ or B-) & {TH+ or C+ +or QI+ or @MV+}); +%#told: {@E-} & (M- or Pv- or ((S- or (RS- & B-) or PP-) & (O+ or B-))) & +%#{TH+ or C+ or QI+ or @MV+}; +%#telling: {@E-} & (Pg- or M-) & ((O+ or B-) & {TH+ or C+ or QI+ or +%#@MV+}); + +% END OF VERBS + +%#recently sometimes soon gradually specifically generally initially +%#ultimately already now sadly broadly: +%#E+ or MV-; +לאחרונה לפעמים בקרוב בהדרגה במיוחד באופן_כללי בתחילה +לבסוף כבר עכשיו בעצבות בהרחבה: +E+ or MV-; + +%#from with at against behind between below above +%#without under for in across through +%#by out up down along like.p on over into about: +%#J+ & (Mp- or MV- or Pp-); +% This doesn't consider the difference between "ב=" with or without a +% definite article included in it. Trying to do so leads to extremely +% complex expression (the same for ל= elsewhere here). +מ= עם ב= מול מאחור בין מלמטה מעל +בלי מתחת בשביל בתוך עבור מעבר דרך ליד חוץ למעלה למטה לאורך כ= כמו על לתוך בערך: +J+ & (Mp- or MV- or Pp-); + +%#of: J+ & Mp-; +של: J+ & Mp-; + +%#here there: MV- or Mp- or Pp-; +כאן שם: J- or (MV- or Mp- or Pp-); + +%#that: (C+ & TH-) +%#or Ds+ or (R- & (C+ or RS+)) or SIs- or (Ss+ & +%#{{@CO-} & {C-}}) or J- or O-; +ש=: (C+ & TH-) +or Ds+ or (R- & (C+ or RS+)) or SIs- or (Ss+ & +{{@CO-} & {C-}}) or J- or O-; + +%#to: (I+ & TO-) or ((MV- or Mp- or Pp-) & J+); +ל=: (I+ & TO-) or ((MV- or Mp- or Pp-) & J+); + +%#who: (R- & (C+ or RS+)) or S+ or B+; +מי: (R- & (C+ or RS+)) or S+ or B+; +%#what: S+ or B+; +מה: S+ or B+; +%#which: (R- & (C+ or RS+)) or S+ or B-; +איזה: (R- & (C+ or RS+)) or S+ or B-; + +%#because unless though although: (C+ & (({Xc+} & CO+) or MV-)); +מפני בגלל מפאת +אילולי למרות_ש= למרות: (C+ & (({Xc+} & CO+) or MV-)); +%#after before since until: (C+ or J+) & (({Xc+} & CO+) or MV- or Mp-); +אחרי לפני מאז עד: (C+ or J+) & (({Xc+} & CO+) or MV- or Mp-); +%#if: C+ & (({Xc+} & CO+) or MV-); +אם: C+ & (({Xc+} & CO+) or MV-); + +%#when: (QI- & C+) or Q+ or (C+ & (({Xc+} & CO+) or MV-)); +כאשר כש=: (QI- & C+) or Q+ or (C+ & (({Xc+} & CO+) or MV-)); +%#where:(QI- & C+) or Q+; +איפה:(QI- & C+) or Q+; +%#how: (QI- & (C+ or EA+)) or Q+ or EA+; +איך: (QI- & (C+ or EA+)) or Q+ or EA+; + +%#fast slow short long black white big small beautiful ugly tired angry: +%# {EA-} & (A- or ((Pa- or AF+) & {@MV+})); +מהיר אטי קצר ארוך שחור לבן גדול קטן יפה מכוער עייף כועס: + {EA-} & (A- or ((Pa- or AF+) & {@MV+})); + +%#glad afraid scared.a fortunate unfortunate lucky unlucky certain sure: +%#{EA-} & (A- or ((Pa- or AF+) & {@MV+} & {C+ or TO+ or TH+})); +שמח שמחה מפחד מפחדת מפוחד מפוחדת בר_מזל בת_מזל ביש_מזל בטוח בטוחה: + {EA-} & (A- or ((Pa- or AF+) & {@MV+} & {C+ or TO+ or TH+})); + +%#very: EA+; +מאד: EA+; + +%#but and: MV- & C+; +אבל ו=: MV- & C+; + +",": Xc-; + +% No actual definition yet - defined here because they appear as possible +% prefixes in 4.0.affix. +לכש= ככ= מב= מל= מש=: (); + +% prefix stripping tests +שכבה כבה בה: (); + +% With the following line in the dictionary, the parser will simply +% skip over (null-link) unknown words. If you remove it, the parser +% will output an error for any unknown words. +UNKNOWN-WORD: XXX+; diff --git a/data/he/Makefile.am b/data/he/Makefile.am index 743a16f..5cb43fa 100644 --- a/data/he/Makefile.am +++ b/data/he/Makefile.am @@ -3,6 +3,7 @@ DICTS= \ 4.0.affix \ 4.0.constituent-knowledge \ 4.0.dict \ + 4.0.dict.m4 \ 4.0.knowledge \ 4.0.regex diff --git a/data/he/Makefile.in b/data/he/Makefile.in index a73a653..3a3330b 100644 --- a/data/he/Makefile.in +++ b/data/he/Makefile.in @@ -341,6 +341,7 @@ DICTS = \ 4.0.affix \ 4.0.constituent-knowledge \ 4.0.dict \ + 4.0.dict.m4 \ 4.0.knowledge \ 4.0.regex diff --git a/debug/README.md b/debug/README.md new file mode 100644 index 0000000..b790930 --- /dev/null +++ b/debug/README.md @@ -0,0 +1,217 @@ +Debugging +========= + +There link-grammar library has API calls to ease debugging and development. +The `link-parser` program has corresponding options for this API. + +Only the `link-parser` options will be discussed here. +Options to `link-parser` at the command-line are preceded with a `-` sign. +You can use a unique prefix of an option name instead of its full name. At +the **linkparser>** prompt or in batch files, options are preceded with +a `!` character. + +For info on common options, see the "Special ! options" of the `link-grammar` +manual. For a general help message use `link-parser -help`. + + +Debug options +------------- + +### 1) -verbosity=N (-v=N) +Sets the verbosity level of the library to N (a small non-negative integer). + +#### Verbosity levels +0: Certain informative messages are not printed by the +library. `link-parser` also doesn't print its usual **linkparser>** +prompt. This is the current default verbosity level for the Python +binding. + +1: This is the library default. This is also the default for +`link-parser`. + +2: Display parsing steps time. In case an error/warning gets issued by the library, +this may help finding out at which step it happened. + +3: Display data file search and locale setup. It can be used to debug +problems with the locale setup or in finding the dictionary. + +4: Not in use for now. + +5-9: Show trace and debug messages regarding sentence handling. Higher +levels include the messages of the lower ones. + +10-99: Show also trace and debug messages regarding reading the +dictionary. As with levels greater then 4, higher levels include the +messages of the lower ones. + +* 10: Basic dictionary debug. + +100-...: Show only messages exactly at the specified level. +* 101: Print all the connectors, along with their length limit. + A length limit of 0 means the value of the short\_length option is used. + +* 102: do_count() memoizing table statistics (in DEBUG mode only). + +* 103: Show unsubscripted dictionary words and subscripted ones which share + the same base word. +* 104: Memory pool statistics. + +### 2) -debug=LOCATIONS (-de=LOCATIONS) +Show only messages from these LOCATIONS. The LOCATIONS string is a +comma-separated list of source file names (without specifying their +directory) and function names (fully qualified for C++) from which to +show the messages. + +For example, to only show messages from the `flatten_wordgraph()` function +or the print.c file: + +`link-parser -v=6 -debug=flatten_wordgraph,print.c` + +Note that since print.c is used to produce certain messages, it is +currently needed to add it to the debug LOCATIONS list unless you +explicitly specify also the function in print.c (to further restrict +the messages). + +### 3) -test=FEATURES (-te=FEATURES) +Enable certain features. These can be debug aids, or new features that +are not yet official or fully-developed. + +For example, to automatically show all linkages of a sentence, the +following can be done: + +`link-parser -test=auto-next-linkage` + +Useful examples +--------------- + +### -debug=... + +1) See the tokens after flattening into the word array used by the parser: + +``` +echo "Let's test it" | \ +link-parser -v=6 -debug=flatten_wordgraph,print_sentence_word_alternatives +``` + +2) Trace the work of `sane_linkage_morphism()`: + +`link-parser -v=8 -debug=sane_linkage_morphism` + +3) Same as (2) above, but also see other messages from sane.c: + +`link-parser -v=8 -debug=sane.c` + +(`sane_linkage_morphism()` happens to be in `sane.c` so this includes its +messages.) + +4) Debug the tokenizer: + +`link-parser -v=7 -debug=tokenizer.c` + +Or, in order to display the word array: + +`link-parser -v=7 -debug=tokenize.c,print_sentence_word_alternatives` + +5) Debug post-processing: + +`link-parser -v=9 -debug=post-process.c` + +6) Debug expression pruning: + +`link-parser -v=9 -debug=expression_prune` + +7) Debug reading the affix and knowledge files: + +`link-parser -v=11` + +### -test=... + +1) Automatically show all linkages: + +`link-parser -test=auto-next-linkage` +Try to type some sentences at the **linkparser>** prompt to see its action. + +2) Print more that 1024 linkages in `link-parser` (this is the maximum +`link-parser` would print by default), e.g. 20000: + +`link-parser -test=auto-next-linkage:20000` + +3) To print detailed linkages of **data/en/corpus-basic.batch**: + +``` +sed '/^*/d;/^!const/d;/^!batch/d' data/en/corpus-basic.batch | \ +link-parser -test=auto-next-linkage +``` + +(If you cut&paste it to a terminal, remember to escape each of the "**!**" characters +with a backslash.) + +This, along with "diff", "grep" etc., can be used in order to validate +that a change didn't cause undesired effects. Special care should be taken +if sentences with more than 1024 linkages are to be verified too (use a +larger `-limit=N` and -test=auto-next-linkage:M`, when N>>M). + +Note that this technique is not very effective if the order to the +linkages got changed (or if SAT-parser linkages need to be compared to the +classic-parser linkages). In that case the detailed linkages results need +to be filtered through a script which sorts them according to some +"canonical order" and also removes duplicates. + +4) Display the wordgraph: +Currently, to use this feature, the library needs to be compiled with +`--enable-wordgraph-display`. + +`link-parser -test=wg` + +or + +`link-parser -test=wg:OPTIONS` + +For more examples of how to use the wordgraph display, see +[link-grammar/README.md](/link-grammar/README.md) +and [msvc/README.md](/msvc/README.md). + +Debugging and STDIO streams +--------------------------- +Messages at severity Info and higher (i.e. also Warning, Error and +Fatal) are printed to `stderr`. The other severities +(at Debug and below, i.e also +Trace and None) are printed to `stdout`. The rational is that +debugging messages, in order to be useful, need to appear along with the +regular output of the program, while errors are exceptional and need to +stand out when `link-parser`s `stdout` is redirected to a file. + +The C API includes the ability to set the severity level threshold above +which messages are printed to `stderr` (see +"Improved error notification facility"->"C API" in +[link-grammar/README.md](/link-grammar/README.md)). + +Note that when debugging errors during a sentence batch run, it may be useful to +redirect also `stderr` to the same file (the error facility of the library +flushes `stdout` before printing in order to preserve output order). + +Configuring for debug +--------------------- +Use: + +`configure --enable-debug --enable-wordgraph-display` + +For SAT solver debug: +`make -DSAT\_DEBUG` + +### --enable-debug +Its sets te DEBUG definitions and removes the optimization flags of the +compiler. The DEBUG definition adds various validity checks, test +messages, and some debug functions (that can be invoked, for example, from +the debugger). + +### --enable-wordgraph-display +If something goes wrong, it is often useful to display the wordgraph. +The wordgraph display function can be invoked from `gdb` using: + +`call wordgraph\_show(sent, "")` + +supposing that "sent" is available (the stack can be rolled down for +that using the "down" or "frame" `gdb` commands). + +The second argument can include wordgraph display options. diff --git a/link-grammar.spec b/link-grammar.spec index b248ffc..6ffa365 100644 --- a/link-grammar.spec +++ b/link-grammar.spec @@ -1,5 +1,5 @@ %define name link-grammar -%define version 5.5.0 +%define version 5.5.1 %define release 1 Summary: A Natural Language Parser based on Link Grammar Theory diff --git a/link-grammar/Makefile.am b/link-grammar/Makefile.am index 634632c..bb80022 100644 --- a/link-grammar/Makefile.am +++ b/link-grammar/Makefile.am @@ -203,10 +203,6 @@ EXTRA_DIST= \ dict-sql/README.md \ tokenize/README.md -# Clean up generated file that Windows MSVC compilation leaves behind. -clean-local: - rm -f $(top_builddir)/link-grammar/link-features.h - # ----------------------------------------------------------- install-data-local: install-libtool-import-lib diff --git a/link-grammar/Makefile.in b/link-grammar/Makefile.in index 18d6bc2..0f54f3a 100644 --- a/link-grammar/Makefile.in +++ b/link-grammar/Makefile.in @@ -1197,7 +1197,7 @@ maintainer-clean-generic: -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive @@ -1273,13 +1273,13 @@ uninstall-am: uninstall-libLTLIBRARIES \ .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-local cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES \ install-liblink_grammar_includeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ @@ -1305,10 +1305,6 @@ post-process/pp_lexer.lo: AM_CPPFLAGS += -I$(top_srcdir)/link-grammar/post-proce uninstall-hook: -rmdir $(liblink_grammar_includedir) -# Clean up generated file that Windows MSVC compilation leaves behind. -clean-local: - rm -f $(top_builddir)/link-grammar/link-features.h - # ----------------------------------------------------------- install-data-local: install-libtool-import-lib diff --git a/link-grammar/api-structures.h b/link-grammar/api-structures.h index 75dc161..85c0f41 100644 --- a/link-grammar/api-structures.h +++ b/link-grammar/api-structures.h @@ -70,16 +70,18 @@ struct Parse_Options_s { /* General options */ short verbosity; /* Level of detail to give about the computation 0 */ - char * debug; /* comma-separated function names to debug "" */ - char * test; /* comma-separated features to test "" */ + char * debug; /* Comma-separated function names to debug "" */ + char * test; /* Comma-separated features to test "" */ Resources resources; /* For deciding when to abort the parsing */ /* Options governing the tokenizer (sentence-splitter) */ - short use_spell_guess; /* Perform spell-guessing of unknown words. */ + short use_spell_guess; /* Up to this many spell-guesses per unknown word 7 */ /* Choice of the parser to use */ bool use_sat_solver; /* Use the Boolean SAT based parser */ +#ifdef USE_VITERBI bool use_viterbi; /* Use the Viterbi decoder-based parser */ +#endif /* Options governing the parser internals operation */ double disjunct_cost; /* Max disjunct cost to allow */ @@ -90,18 +92,18 @@ struct Parse_Options_s will be generated (default=FALSE) */ bool use_cluster_disjuncts; /* Attempt using a broader list of disjuncts */ size_t short_length; /* Links that are limited in length can be - no longer than this. Default = 6 */ + no longer than this. Default = 16 */ bool all_short; /* If true, there can be no connectors that are exempt */ bool repeatable_rand; /* Reset rand number gen after every parse. */ /* Options governing post-processing */ - bool perform_pp_prune; /* Perform post-processing-based pruning */ - size_t twopass_length; /* min sent length for two-pass post processing */ + bool perform_pp_prune; /* Perform post-processing-based pruning TRUE */ + size_t twopass_length; /* Min sent length for two-pass post processing */ Cost_Model cost_model; /* For sorting linkages after parsing. */ /* Options governing the generation of linkages. */ size_t linkage_limit; /* The maximum number of linkages processed 100 */ - bool display_morphology;/* if true, print morpho analysis of words */ + bool display_morphology;/* If true, print morpho analysis of words FALSE */ }; typedef struct word_queue_s word_queue_t; diff --git a/link-grammar/api.c b/link-grammar/api.c index 2e9d776..e4291db 100644 --- a/link-grammar/api.c +++ b/link-grammar/api.c @@ -119,7 +119,9 @@ Parse_Options parse_options_create(void) po->max_null_count = 0; po->islands_ok = false; po->use_sat_solver = false; +#ifdef USE_VITERBI po->use_viterbi = false; +#endif po->linkage_limit = 100; #if defined HAVE_HUNSPELL || defined HAVE_ASPELL po->use_spell_guess = 7; @@ -292,6 +294,7 @@ bool parse_options_get_use_sat_parser(Parse_Options opts) { return opts->use_sat_solver; } +#ifdef USE_VITERBI void parse_options_set_use_viterbi(Parse_Options opts, bool dummy) { opts->use_viterbi = dummy; } @@ -299,6 +302,7 @@ void parse_options_set_use_viterbi(Parse_Options opts, bool dummy) { bool parse_options_get_use_viterbi(Parse_Options opts) { return opts->use_viterbi; } +#endif void parse_options_set_linkage_limit(Parse_Options opts, int dummy) { @@ -533,6 +537,9 @@ void sentence_delete(Sentence sent) global_rand_state = sent->rand_state; pool_delete(sent->fm_Match_node); pool_delete(sent->Table_connector_pool); + if (IS_DB_DICT(sent->dict)) + condesc_reuse(sent->dict); + free(sent); } @@ -629,6 +636,11 @@ int sentence_parse(Sentence sent, Parse_Options opts) resources_reset(opts->resources); + /* When the SQL dict is used, expressions are read on demand, so + * the connector descriptor table is not yet ready at this point. */ + if (IS_DB_DICT(sent->dict)) + condesc_setup(sent->dict); + /* Expressions were set up during the tokenize stage. * Prune them, and then parse. */ diff --git a/link-grammar/connectors.c b/link-grammar/connectors.c index f3ef1a2..0995b58 100644 --- a/link-grammar/connectors.c +++ b/link-grammar/connectors.c @@ -63,6 +63,7 @@ Connector * connector_new(const condesc_t *desc, Parse_Options opts) c->desc = desc; c->nearest_word = 0; c->multi = false; + c->originating_gword = NULL; set_connector_length_limit(c, opts); //assert(0 != c->length_limit, "Connector_new(): Zero length_limit"); @@ -70,7 +71,7 @@ Connector * connector_new(const condesc_t *desc, Parse_Options opts) } /* ======================================================== */ -/* UNLIMITED-CONNECTORS handling. */ +/* Connector length limit handling - UNLIMITED-CONNECTORS and LENGTH-LIMIT-n. */ static size_t get_connectors_from_expression(condesc_t **conlist, const Exp *e) { @@ -249,8 +250,8 @@ static bool connector_encode_lc(const char *lc_string, condesc_t *desc) return false; } - desc->lc_mask = lc_mask; - desc->lc_letters = lc_value; + desc->lc_mask = (lc_mask << 1) + !!(desc->flags & CD_HEAD_DEPENDENT); + desc->lc_letters = (lc_value << 1) + !!(desc->flags & CD_HEAD); return true; } @@ -260,15 +261,18 @@ static bool connector_encode_lc(const char *lc_string, condesc_t *desc) * This information is used to speed up the parsing stage. It is * calculated during the directory creation and doesn't change afterward. */ -bool calculate_connector_info(condesc_t * c) +static bool calculate_connector_info(condesc_t * c) { const char *s; - unsigned int i; s = c->string; - if (islower((int) *s)) s++; /* ignore head-dependent indicator */ - c->head_dependent = (c->string == s)? '\0' : c->string[0]; + if (islower(*s)) s++; /* ignore head-dependent indicator */ + if ((c->string[0] == 'h') || (c->string[0] == 'd')) + c->flags |= CD_HEAD_DEPENDENT; + if ((c->flags & CD_HEAD_DEPENDENT) && (c->string[0] == 'h')) + c->flags |= CD_HEAD; +#if 0 /* For most situations, all three hashes are very nearly equal; * as to which is faster depends on the parsed text. * For both English and Russian, there are about 100 pre-defined @@ -278,7 +282,7 @@ bool calculate_connector_info(condesc_t * c) * cost of collisions. */ #ifdef USE_DJB2 /* djb2 hash */ - i = 5381; + uint32_t i = 5381; while (isupper((int) *s)) /* connector tables cannot contain UTF8, yet */ { i = ((i << 5) + i) + *s; @@ -290,7 +294,7 @@ bool calculate_connector_info(condesc_t * c) #define USE_JENKINS #ifdef USE_JENKINS /* Jenkins one-at-a-time hash */ - i = 0; + uint32_t i = 0; c->uc_start = s - c->string; while (isupper((int) *s)) /* connector tables cannot contain UTF8, yet */ { @@ -306,7 +310,7 @@ bool calculate_connector_info(condesc_t * c) #ifdef USE_SDBM /* sdbm hash */ - i = 0; + uint32_t i = 0; c->uc_start = s - c->string; while (isupper((int) *s)) { @@ -315,14 +319,62 @@ bool calculate_connector_info(condesc_t * c) } #endif /* USE_SDBM */ - c->uc_length = s - c->string - c->uc_start; - c->uc_hash = i; + //c->uc_hash = i; +#else + + + c->uc_start = (uint8_t)(s - c->string); + while (isupper(*++s)) /* The first letter must be an uppercase one. */ + ; +#endif + c->uc_length = (uint8_t)(s - c->string - c->uc_start); return connector_encode_lc(s, c); } /* ================= Connector descriptor table. ====================== */ +static uint32_t connector_str_hash(const char *s) +{ + uint32_t i; + + /* For most situations, all three hashes are very nearly equal; + * as to which is faster depends on the parsed text. + * For both English and Russian, there are about 100 pre-defined + * connectors, and another 2K-4K autogen'ed ones (the IDxxx idiom + * connectors, and the LLxxx suffix connectors for Russian). + * Turns out the cost of setting up the hash table dominates the + * cost of collisions. */ +#ifdef USE_DJB2 + /* djb2 hash */ + i = 5381; + while (*s) + { + i = ((i << 5) + i) + *s; + s++; + } + i += i>>14; +#endif /* USE_DJB2 */ + +#define USE_JENKINS +#ifdef USE_JENKINS + /* Jenkins one-at-a-time hash */ + i = 0; + while (*s) + { + i += *s; + i += (i<<10); + i ^= (i>>6); + s++; + } + i += (i << 3); + i ^= (i >> 11); + i += (i << 15); +#endif /* USE_JENKINS */ + + return i; +} + /** * Compare connector UC parts, for qsort. */ @@ -365,26 +417,37 @@ static int condesc_by_uc_constring(const void * a, const void * b) /** * Enumerate the connectors by their UC parts - equal parts get the same number. - * It replaces the existing connector UC-part hash, and can later serve - * as table index as if it was a perfect hash. + * It can later serve as a table index, as if it was a perfect hash. */ -void sort_condesc_by_uc_constring(Dictionary dict) +bool sort_condesc_by_uc_constring(Dictionary dict) { - if (0 == dict->contable.num_con) + if ((0 == dict->contable.num_con) && !IS_DB_DICT(dict)) { prt_error("Error: Dictionary %s: No connectors found.\n", dict->name); - /* FIXME: Generate a dictionary open error. */ - return; + return false; + } + + /* An SQL dict without may have 0 connectors here. */ + if (0 == dict->contable.num_con) + return true; + + condesc_t **sdesc = malloc(dict->contable.num_con * sizeof(condesc_t *)); + size_t i = 0; + for (size_t n = 0; n < dict->contable.size; n++) + { + condesc_t *condesc = dict->contable.hdesc[n].desc; + + if (NULL == condesc) continue; + if (!calculate_connector_info(condesc)) + return false; + sdesc[i++] = dict->contable.hdesc[n].desc; } - condesc_t **sdesc = malloc(dict->contable.size * sizeof(*dict->contable.hdesc)); - memcpy(sdesc, dict->contable.hdesc, dict->contable.size * sizeof(*dict->contable.hdesc)); - qsort(sdesc, dict->contable.size, sizeof(*dict->contable.hdesc), + qsort(sdesc, dict->contable.num_con, sizeof(*dict->contable.sdesc), condesc_by_uc_constring); /* Enumerate the connectors according to their UC part. */ int uc_num = 0; - uint32_t uc_hash = sdesc[0]->uc_hash; /* Will be recomputed */ sdesc[0]->uc_num = uc_num; for (size_t n = 1; n < dict->contable.num_con; n++) @@ -393,8 +456,7 @@ void sort_condesc_by_uc_constring(Dictionary dict) //#define DEBUG_UC_HASH_CHANGE #ifndef DEBUG_UC_HASH_CHANGE /* Use a shortcut - not needed for correctness. */ - if ((condesc[0]->uc_hash != uc_hash) || - (condesc[0]->uc_length != condesc[-1]->uc_length)) + if (condesc[0]->uc_length != condesc[-1]->uc_length) { /* We know that the UC part has been changed. */ @@ -411,9 +473,8 @@ void sort_condesc_by_uc_constring(Dictionary dict) } } - uc_hash = condesc[0]->uc_hash; //printf("%5d constring=%s\n", uc_num, condesc[0]->string); - condesc[0]->uc_hash = uc_num; + condesc[0]->uc_num = uc_num; } lgdebug(+11, "Dictionary %s: %zu different connectors " @@ -422,22 +483,37 @@ void sort_condesc_by_uc_constring(Dictionary dict) dict->contable.sdesc = sdesc; dict->contable.num_uc = uc_num + 1; + + /* hdesc is not freed here because it is needed for finding ZZZ. + * It could be freed here if we have ZZZ cached in the dict structure. */ + return true; } void condesc_delete(Dictionary dict) { - pool_delete(dict->contable.mempool); - free(dict->contable.hdesc); - free(dict->contable.sdesc); - condesc_length_limit_def_delete(&dict->contable); + ConTable *ct = &dict->contable; + + free(ct->hdesc); + pool_delete(ct->mempool); + condesc_length_limit_def_delete(ct); +} + +void condesc_reuse(Dictionary dict) +{ + ConTable *ct = &dict->contable; + + ct->num_con = 0; + ct->num_uc = 0; + memset(ct->hdesc, 0, ct->size * sizeof(hdesc_t)); + pool_reuse(ct->mempool); } -static condesc_t **condesc_find(ConTable *ct, const char *constring, int hash) +static hdesc_t *condesc_find(ConTable *ct, const char *constring, uint32_t hash) { - size_t i = hash & (ct->size-1); + uint32_t i = hash & (ct->size-1); - while ((NULL != ct->hdesc[i]) && - !string_set_cmp(constring, ct->hdesc[i]->string)) + while ((NULL != ct->hdesc[i].desc) && + !string_set_cmp(constring, ct->hdesc[i].desc->string)) { i = (i + 1) & (ct->size-1); } @@ -447,45 +523,34 @@ static condesc_t **condesc_find(ConTable *ct, const char *constring, int hash) static void condesc_table_alloc(ConTable *ct, size_t size) { - ct->hdesc = (condesc_t **)malloc(size * sizeof(condesc_t *)); - memset(ct->hdesc, 0, size * sizeof(condesc_t *)); + ct->hdesc = malloc(size * sizeof(hdesc_t)); + memset(ct->hdesc, 0, size * sizeof(hdesc_t)); ct->size = size; } -static bool condesc_insert(ConTable *ct, condesc_t **h, - const char *constring, int hash) -{ - *h = pool_alloc(ct->mempool); - (*h)->str_hash = hash; - (*h)->string = constring; - ct->num_con++; - - return calculate_connector_info(*h); -} - #define CONDESC_TABLE_GROW_FACTOR 2 static bool condesc_grow(ConTable *ct) { size_t old_size = ct->size; - condesc_t **old_hdesc = ct->hdesc; + hdesc_t *old_hdesc = ct->hdesc; lgdebug(+11, "Growing ConTable from %zu\n", old_size); condesc_table_alloc(ct, ct->size * CONDESC_TABLE_GROW_FACTOR); for (size_t i = 0; i < old_size; i++) { - condesc_t *old_h = old_hdesc[i]; - if (NULL == old_h) continue; - condesc_t **new_h = condesc_find(ct, old_h->string, old_h->str_hash); + hdesc_t *old_h = &old_hdesc[i]; + if (NULL == old_h->desc) continue; + hdesc_t *new_h = condesc_find(ct, old_h->desc->string, old_h->str_hash); - if (NULL != *new_h) + if (NULL != new_h->desc) { prt_error("Fatal Error: condesc_grow(): Internal error\n"); free(old_hdesc); return false; } - *new_h = old_h; + *new_h = *old_h; } free(old_hdesc); @@ -494,22 +559,18 @@ static bool condesc_grow(ConTable *ct) condesc_t *condesc_add(ConTable *ct, const char *constring) { - if (0 == ct->size) - { - condesc_table_alloc(ct, ct->num_con); - ct->num_con = 0; - ct->mempool = pool_new(__func__, "ConTable", - /*num_elements*/1024, sizeof(condesc_t), - /*zero_out*/true, /*align*/true, /*exact*/false); - } + uint32_t hash = (connector_hash_t)connector_str_hash(constring); + hdesc_t *h = condesc_find(ct, constring, hash); - int hash = connector_str_hash(constring); - condesc_t **h = condesc_find(ct, constring, hash); - - if (NULL == *h) + if (NULL == h->desc) { - lgdebug(+11, "Creating connector '%s'\n", constring); - if (!condesc_insert(ct, h, constring, hash)) return NULL; + assert(0 == ct->num_uc, "Trying to add a connector (%s) " + "after reading the dict.\n", constring); + lgdebug(+11, "Creating connector '%s' (%zu)\n", constring, ct->num_con); + h->desc = pool_alloc(ct->mempool); + h->desc->string = constring; + h->str_hash = hash; + ct->num_con++; if ((8 * ct->num_con) > (3 * ct->size)) { @@ -518,6 +579,26 @@ condesc_t *condesc_add(ConTable *ct, const char *constring) } } - return *h; + return h->desc; +} + +void condesc_init(Dictionary dict, size_t num_con) +{ + ConTable *ct = &dict->contable; + + condesc_table_alloc(ct, num_con); + ct->mempool = pool_new(__func__, "ConTable", + /*num_elements*/1024, sizeof(condesc_t), + /*zero_out*/true, /*align*/true, /*exact*/false); + + ct->length_limit_def = NULL; + ct->length_limit_def_next = &ct->length_limit_def; +} + +void condesc_setup(Dictionary dict) +{ + sort_condesc_by_uc_constring(dict); + set_all_condesc_length_limit(dict); + free(dict->contable.sdesc); } /* ========================= END OF FILE ============================== */ diff --git a/link-grammar/connectors.h b/link-grammar/connectors.h index 5ec8310..6cb8e47 100644 --- a/link-grammar/connectors.h +++ b/link-grammar/connectors.h @@ -38,33 +38,32 @@ #define LC_MASK ((1<desc->uc_hash; + return c->desc->uc_num; } static inline int connector_uc_num(const Connector * c) @@ -205,12 +214,8 @@ static inline bool easy_match(const char * s, const char * t) */ static bool lc_easy_match(const condesc_t *c1, const condesc_t *c2) { - if ((c1->lc_letters ^ c2->lc_letters) & c1->lc_mask & c2->lc_mask) - return false; - if (('\0' != c1->head_dependent) && (c1->head_dependent == c2->head_dependent)) - return false; - - return true; + return (((c1->lc_letters ^ c2->lc_letters) & c1->lc_mask & c2->lc_mask) == + (c1->lc_mask & c2->lc_mask & 1)); } /** @@ -223,7 +228,7 @@ static inline bool easy_match_desc(const condesc_t *c1, const condesc_t *c2) return lc_easy_match(c1, c2); } -static inline int string_hash(const char *s) +static inline uint32_t string_hash(const char *s) { unsigned int i; @@ -237,49 +242,6 @@ static inline int string_hash(const char *s) return i; } -bool calculate_connector_info(condesc_t *); - -static inline int connector_str_hash(const char *s) -{ - uint32_t i; - - /* For most situations, all three hashes are very nearly equal; - * as to which is faster depends on the parsed text. - * For both English and Russian, there are about 100 pre-defined - * connectors, and another 2K-4K autogen'ed ones (the IDxxx idiom - * connectors, and the LLxxx suffix connectors for Russian). - * Turns out the cost of setting up the hash table dominates the - * cost of collisions. */ -#ifdef USE_DJB2 - /* djb2 hash */ - i = 5381; - while (*s) - { - i = ((i << 5) + i) + *s; - s++; - } - i += i>>14; -#endif /* USE_DJB2 */ - -#define USE_JENKINS -#ifdef USE_JENKINS - /* Jenkins one-at-a-time hash */ - i = 0; - while (*s) - { - i += *s; - i += (i<<10); - i ^= (i>>6); - s++; - } - i += (i << 3); - i ^= (i >> 11); - i += (i << 15); -#endif /* USE_JENKINS */ - - return i; -} - /** * hash function. Based on some tests, this seems to be an almost * "perfect" hash, in that almost all hash buckets have the same size! diff --git a/link-grammar/dict-common/dict-common.h b/link-grammar/dict-common/dict-common.h index bd52b36..6e8ee2e 100644 --- a/link-grammar/dict-common/dict-common.h +++ b/link-grammar/dict-common/dict-common.h @@ -14,10 +14,10 @@ #ifndef _LG_DICT_COMMON_H_ #define _LG_DICT_COMMON_H_ -#include "api-types.h" // for pp_knowledge -#include "connectors.h" // for condest_t +#include "api-types.h" // pp_knowledge +#include "connectors.h" // ConTable #include "dict-structures.h" -#include "utilities.h" // for locale_t +#include "utilities.h" // locale_t #define EMPTY_CONNECTOR "ZZZ" #define UNLIMITED_CONNECTORS_WORD ("UNLIMITED-CONNECTORS") @@ -67,6 +67,12 @@ struct Afdict_class_struct #define MAX_TOKEN_LENGTH 250 /* Maximum number of chars in a token */ #define IDIOM_LINK_SZ 5 +#ifdef HAVE_SQLITE +#define IS_DB_DICT(dict) (NULL != dict->db_handle) +#else +#define IS_DB_DICT(dict) false +#endif /* HAVE_SQLITE */ + struct Dictionary_s { Dict_node * root; diff --git a/link-grammar/dict-common/dict-impl.c b/link-grammar/dict-common/dict-impl.c index e90afd2..2fe8705 100644 --- a/link-grammar/dict-common/dict-impl.c +++ b/link-grammar/dict-common/dict-impl.c @@ -342,9 +342,15 @@ void dictionary_setup_defines(Dictionary dict) dict->unknown_word_defined = boolean_dictionary_lookup(dict, UNKNOWN_WORD); dict->use_unknown_word = true; - dict->shuffle_linkages = false; + /* In version 5.5.0 UNKNOWN_WORD has been replaced by . */ + if (!dict->unknown_word_defined && + boolean_dictionary_lookup(dict, "UNKNOWN-WORD")) + { + prt_error("Warning: Old name \"UNKNOWN-WORD\" is defined in the " + "dictionary. Please use \"\" instead.\n"); + } - set_all_condesc_length_limit(dict); + dict->shuffle_linkages = false; } /* ======================================================================= */ diff --git a/link-grammar/dict-common/print-dict.c b/link-grammar/dict-common/print-dict.c index 8b06a6e..88a89ec 100644 --- a/link-grammar/dict-common/print-dict.c +++ b/link-grammar/dict-common/print-dict.c @@ -82,21 +82,44 @@ static dyn_str *print_expression_parens(dyn_str *e, if (n == NULL) { - append_string(e, "NULL expression"); + dyn_strcat(e, "NULL expression"); return e; } - icost = (int) (n->cost); - dcost = n->cost - icost; - if (dcost > 10E-4) + if (n->cost < -10E-4) { - dcost = n->cost; icost = 1; + dcost = n->cost; } - else + else if ((n->cost > -10E-4) && (n->cost < 0)) { + /* avoid [X+]-0.00 */ + icost = 0; dcost = 0; } + else + { + icost = (int) (n->cost); + dcost = n->cost - icost; + if (dcost > 10E-4) + { + dcost = n->cost; + icost = 1; + } + else + { + if (icost > 4) + { + /* don't print too many [] levels */ + dcost = icost; + icost = 1; + } + else + { + dcost = 0; + } + } + } /* print the connector only */ if (n->type == CONNECTOR_type) @@ -109,24 +132,27 @@ static dyn_str *print_expression_parens(dyn_str *e, return e; } - /* Look for optional, and print only that */ el = n->u.l; if (el == NULL) { for (i=0; itype == OR_type) && el->e && (NULL == el->e->u.l)) + + /* look for optional, and print only that */ + if ((n->type == OR_type) && el->e && el->e->cost == 0 && (NULL == el->e->u.l)) { dyn_strcat(e, "{"); if (NULL == el->next) dyn_strcat(e, "error-no-next"); else print_expression_parens(e, el->next->e, false); - append_string(e, "}"); + dyn_strcat(e, "}"); + for (i=0; ie, true); - /* get a funny "and optional" when its a named expression thing. */ + /* get a funny "and optional" when it's a named expression thing. */ if ((n->type == AND_type) && (el->next == NULL)) { for (i=0; ilang); dict->name = string_set_add(dict_name, dict->string_set); - memset(dict->current_idiom, 'A', IDIOM_LINK_SZ-1); - dict->current_idiom[IDIOM_LINK_SZ-1] = 0; - /* * A special setup per dictionary type. The check here assumes the affix * dictionary name contains "affix". FIXME: For not using this @@ -139,13 +132,15 @@ dictionary_six_str(const char * lang, if (verbosity_level(D_USER_BASIC) && (NULL == dict->spell_checker)) prt_error("Info: %s: Spell checker disabled.\n", dict->lang); #endif - dict->insert_entry = insert_list; + memset(dict->current_idiom, 'A', IDIOM_LINK_SZ-1); + dict->current_idiom[IDIOM_LINK_SZ-1] = 0; + dict->insert_entry = insert_list; dict->lookup_list = file_lookup_list; dict->lookup_wild = file_lookup_wild; dict->free_lookup = free_llist; dict->lookup = file_boolean_lookup; - dict->contable.num_con = 1<<13; + condesc_init(dict, 1<<13); } else { @@ -155,25 +150,16 @@ dictionary_six_str(const char * lang, afclass_init(dict); dict->insert_entry = load_affix; dict->lookup = return_true; - dict->contable.num_con = 1<<9; + condesc_init(dict, 1<<9); } - dict->affix_table = NULL; - - dict->contable.size = 0; - dict->contable.length_limit_def = NULL; - dict->contable.length_limit_def_next = &dict->contable.length_limit_def; /* Read dictionary from the input string. */ dict->input = input; dict->pin = dict->input; if (!read_dictionary(dict)) { - dict->pin = NULL; - dict->input = NULL; goto failure; } - dict->pin = NULL; - dict->input = NULL; if (NULL == affix_name) { @@ -227,8 +213,8 @@ dictionary_six_str(const char * lang, dict->base_knowledge = pp_knowledge_open(pp_name); dict->hpsg_knowledge = pp_knowledge_open(cons_name); - sort_condesc_by_uc_constring(dict); dictionary_setup_defines(dict); + condesc_setup(dict); // Special-case hack. if ((0 == strncmp(dict->lang, "any", 3)) || @@ -245,7 +231,7 @@ failure: /** * Use filenames of six different files to put together the dictionary. */ -static Dictionary +Dictionary dictionary_six(const char * lang, const char * dict_name, const char * pp_name, const char * cons_name, const char * affix_name, const char * regex_name) diff --git a/link-grammar/dict-file/read-dict.h b/link-grammar/dict-file/read-dict.h index 2d9d889..730a807 100644 --- a/link-grammar/dict-file/read-dict.h +++ b/link-grammar/dict-file/read-dict.h @@ -18,7 +18,10 @@ void print_dictionary_data(Dictionary dict); void print_dictionary_words(Dictionary dict); -Dictionary dictionary_create_from_file(const char * lang); +Dictionary dictionary_six(const char *lang, const char *dict_name, + const char *pp_name, const char *cons_name, + const char *affix_name, const char *regex_name); +Dictionary dictionary_create_from_file(const char *lang); bool read_dictionary(Dictionary dict); Dict_node * file_lookup_list(const Dictionary dict, const char *s); diff --git a/link-grammar/dict-sql/README.md b/link-grammar/dict-sql/README.md index eda5450..3c7fd23 100644 --- a/link-grammar/dict-sql/README.md +++ b/link-grammar/dict-sql/README.md @@ -57,3 +57,8 @@ link-parser foo ``` The above should result in a dictionary that can parse the same sentences as the demo database. + +TODO +---- +* Rename tabvle "Morphemes" to table "tokens". Want consistent naming + with the token flow-graph name. diff --git a/link-grammar/dict-sql/demo.sql b/link-grammar/dict-sql/demo.sql index c0d64b9..46c7e9a 100644 --- a/link-grammar/dict-sql/demo.sql +++ b/link-grammar/dict-sql/demo.sql @@ -24,15 +24,15 @@ INSERT INTO Disjuncts VALUES ('', 'V5v4v0+', 0.0); INSERT INTO Morphemes VALUES ('', '', ''); INSERT INTO Disjuncts VALUES ('', 'EN4us+', 0.0); --- The UNKNOWN-WORD device is needed in order to allow the wild-card +-- The device is needed in order to allow the wild-card -- query of dictionary contents to work. That is, the user can use the -- command-line client to type in `!!blah*` and this will search the -- dictionary for all words whos first four letters are `blah`. You -- are free to replace `XXXBOGUS+` by something useful, for example, -- If you use `Ds- & Os-`, than any word will be accepted as the object! -INSERT INTO Morphemes VALUES ('UNKNOWN-WORD', 'UNKNOWN-WORD', 'UNKNOWN-WORD'); -INSERT INTO Disjuncts VALUES ('UNKNOWN-WORD', 'XXXBOGUS+', 0.0); --- INSERT INTO Disjuncts VALUES ('UNKNOWN-WORD', 'Ds- & Os-', 0.0); +INSERT INTO Morphemes VALUES ('', '', ''); +INSERT INTO Disjuncts VALUES ('', 'XXXBOGUS+', 0.0); +-- INSERT INTO Disjuncts VALUES ('', 'Ds- & Os-', 0.0); -- The following should look familier, if you already understand -- link-grammar basics. diff --git a/link-grammar/dict-sql/read-sql.c b/link-grammar/dict-sql/read-sql.c index 8fa86ae..cd9125c 100644 --- a/link-grammar/dict-sql/read-sql.c +++ b/link-grammar/dict-sql/read-sql.c @@ -23,10 +23,11 @@ #include "connectors.h" #include "dict-common/dict-api.h" #include "dict-common/dict-common.h" -#include "dict-common/dict-defines.h" // for LEFT_WALL_WORD #include "dict-common/dict-impl.h" #include "dict-common/dict-structures.h" +#include "dict-common/dict-utils.h" // free_Exp() #include "dict-common/file-utils.h" +#include "dict-file/read-dict.h" // dictionary_six() #include "externs.h" #include "lg_assert.h" #include "string-set.h" @@ -128,16 +129,16 @@ typedef struct static void db_free_llist(Dictionary dict, Dict_node *llist) { - Dict_node * dn; - while (llist != NULL) - { + Dict_node * dn; + while (llist != NULL) + { Exp *e; - dn = llist->right; + dn = llist->right; e = llist->exp; - if (e) free(e); + if (e) free_Exp(e); free(llist); - llist = dn; - } + llist = dn; + } } /* callback -- set bs->exp to the expressions for a class in the dict */ @@ -369,8 +370,10 @@ Dictionary dictionary_create_from_db(const char *lang) dict->lang = string_set_add(t, dict->string_set); lgdebug(D_USER_FILES, "Debug: Language: %s\n", dict->lang); +#if 0 /* FIXME: Spell checking should be done according to the dict locale. */ /* To disable spell-checking, just set the checker to NULL */ dict->spell_checker = spellcheck_create(dict->lang); +#endif #if defined HAVE_HUNSPELL || defined HAVE_ASPELL /* FIXME: Move to spellcheck-*.c */ if (verbosity_level(D_USER_BASIC) && (NULL == dict->spell_checker)) @@ -391,20 +394,30 @@ Dictionary dictionary_create_from_db(const char *lang) dict->free_lookup = db_free_llist; dict->lookup = db_lookup; dict->close = db_close; + condesc_init(dict, 1<<8); /* Setup the affix table */ - dict->affix_table = (Dictionary) malloc(sizeof(struct Dictionary_s)); - memset(dict->affix_table, 0, sizeof(struct Dictionary_s)); - dict->affix_table->string_set = string_set_create(); - - afclass_init(dict->affix_table); - afdict_init(dict); + char *affix_name = join_path (lang, "4.0.affix"); + dict->affix_table = dictionary_six(lang, affix_name, NULL, NULL, NULL, NULL); + if (dict->affix_table == NULL) + { + prt_error("Error: Could not open affix file %s\n", affix_name); + free(affix_name); + goto failure; + } + free(affix_name); + if (!afdict_init(dict)) + goto failure; dictionary_setup_locale(dict); dictionary_setup_defines(dict); return dict; + +failure: + dictionary_delete(dict); + return NULL; } #endif /* HAVE_SQLITE */ diff --git a/link-grammar/disjunct-utils.c b/link-grammar/disjunct-utils.c index b0e209e..1e15f57 100644 --- a/link-grammar/disjunct-utils.c +++ b/link-grammar/disjunct-utils.c @@ -101,13 +101,17 @@ static inline unsigned int old_hash_disjunct(disjunct_dup_table *dt, Disjunct * unsigned int i; i = 0; for (e = d->left ; e != NULL; e = e->next) { - i += e->desc->str_hash; + i = (5 * (i + e->desc->uc_num)) + (unsigned int)e->desc->lc_letters + 7; } for (e = d->right ; e != NULL; e = e->next) { - i += e->desc->str_hash; + i = (5 * (i + e->desc->uc_num)) + (unsigned int)e->desc->lc_letters + 7; } +#if 0 /* Redundant - the connector hashing has enough entropy. */ i += string_hash(d->word_string); +#endif i += (i>>10); + + d->dup_hash = i; return (i & (dt->dup_table_size-1)); } @@ -149,6 +153,26 @@ static bool disjuncts_equal(Disjunct * d1, Disjunct * d2) return (strcmp(d1->word_string, d2->word_string) == 0); } +#if 0 +int de_fp = 0; +int de_total = 0; +static void disjuncts_equal_stat(void) +{ + fprintf(stderr, "disjuncts_equal FP %d/%d\n", de_fp, de_total); +} + +static bool disjuncts_equal(Disjunct * d1, Disjunct * d2) +{ + if (de_total == 0) atexit(disjuncts_equal_stat); + de_total++; + + bool rc = disjuncts_equal1(d1, d2); + if (!rc) de_fp++; + + return rc; +} +#endif + /** * Duplicate the given connector chain. * If the argument is NULL, return NULL. @@ -371,6 +395,7 @@ Disjunct * eliminate_duplicate_disjuncts(Disjunct * d) for (dx = dt->dup_table[h]; dx != NULL; dx = dx->next) { + if (d->dup_hash != dx->dup_hash) continue; if (disjuncts_equal(dx, d)) break; } if (dx == NULL) diff --git a/link-grammar/disjunct-utils.h b/link-grammar/disjunct-utils.h index 7b2c06f..df986ef 100644 --- a/link-grammar/disjunct-utils.h +++ b/link-grammar/disjunct-utils.h @@ -31,9 +31,11 @@ struct Disjunct_struct /* match_left, right used only during parsing, for the match list. */ bool match_left, match_right; -#ifdef VERIFY_MATCH_LIST - int match_id; /* verify the match list integrity */ -#endif + union + { + unsigned int match_id; /* verify the match list integrity */ + unsigned int dup_hash; /* hash value for duplicate elimination */ + }; gword_set *originating_gword; /* Set of originating gwords */ const char * word_string; /* subscripted dictionary word */ }; diff --git a/link-grammar/link-features.h b/link-grammar/link-features.h index d7463b1..9460e7f 100644 --- a/link-grammar/link-features.h +++ b/link-grammar/link-features.h @@ -30,13 +30,13 @@ #define LINK_MAJOR_VERSION 5 #define LINK_MINOR_VERSION 5 -#define LINK_MICRO_VERSION 0 +#define LINK_MICRO_VERSION 1 -#define LINK_VERSION_STRING "5.5.0" +#define LINK_VERSION_STRING "5.5.1" #define LG_HOST_OS lg_str(linux-gnu) #define LG_CPPFLAGS "CPPFLAGS=" lg_str() #define LG_CFLAGS "CFLAGS=" lg_str(-D_DEFAULT_SOURCE -std=c11 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -D_ISOC11_SOURCE -g -O2 -O3) -#define LG_DEFS lg_str(-DPACKAGE_NAME="link-grammar" -DPACKAGE_TARNAME="link-grammar" -DPACKAGE_VERSION="5.5.0" -DPACKAGE_STRING="link-grammar 5.5.0" -DPACKAGE_BUGREPORT="link-grammar@googlegroups.com" -DPACKAGE_URL="" -DPACKAGE="link-grammar" -DVERSION="5.5.0" -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DHAVE_STRNDUP=1 -DHAVE_STRTOK_R=1 -DHAVE_ALIGNED_ALLOC=1 -DHAVE_POSIX_MEMALIGN=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_PRCTL=1 -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -DHAVE_LOCALE_T_IN_LOCALE_H=1 -DHAVE_STDATOMIC_H=1 -DTLS=__thread -DHAVE_LIBSTDC__=1 -DHAVE_MKLIT=1 -DUSE_SAT_SOLVER=1 -DUSE_WORDGRAPH_DISPLAY=1 -DHAVE_SQLITE=1 -DHAVE_LIBASPELL=1 -DHAVE_ASPELL=1 -DHAVE_EDITLINE=1 -DHAVE_WIDECHAR_EDITLINE=1 -DHAVE_REGEXEC=1 -DHAVE_MAYBE_UNINITIALIZED=1) +#define LG_DEFS lg_str(-DPACKAGE_NAME="link-grammar" -DPACKAGE_TARNAME="link-grammar" -DPACKAGE_VERSION="5.5.1" -DPACKAGE_STRING="link-grammar 5.5.1" -DPACKAGE_BUGREPORT="link-grammar@googlegroups.com" -DPACKAGE_URL="" -DPACKAGE="link-grammar" -DVERSION="5.5.1" -DYYTEXT_POINTER=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DHAVE_STRNDUP=1 -DHAVE_STRTOK_R=1 -DHAVE_ALIGNED_ALLOC=1 -DHAVE_POSIX_MEMALIGN=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_FORK=1 -DHAVE_VFORK=1 -DHAVE_WORKING_VFORK=1 -DHAVE_WORKING_FORK=1 -DHAVE_PRCTL=1 -D__STDC_FORMAT_MACROS=1 -D__STDC_LIMIT_MACROS=1 -DHAVE_LOCALE_T_IN_LOCALE_H=1 -DHAVE_STDATOMIC_H=1 -DTLS=__thread -DHAVE_LIBSTDC__=1 -DHAVE_MKLIT=1 -DUSE_SAT_SOLVER=1 -DUSE_WORDGRAPH_DISPLAY=1 -DHAVE_SQLITE=1 -DHAVE_LIBASPELL=1 -DHAVE_ASPELL=1 -DHAVE_EDITLINE=1 -DHAVE_WIDECHAR_EDITLINE=1 -DHAVE_REGEXEC=1 -DHAVE_MAYBE_UNINITIALIZED=1) #endif diff --git a/link-grammar/link-grammar.def b/link-grammar/link-grammar.def index d52be6e..6d9d4ee 100644 --- a/link-grammar/link-grammar.def +++ b/link-grammar/link-grammar.def @@ -46,8 +46,6 @@ parse_options_set_perform_pp_prune parse_options_get_perform_pp_prune parse_options_set_use_sat_parser parse_options_get_use_sat_parser -parse_options_set_use_viterbi -parse_options_get_use_viterbi parse_options_timer_expired parse_options_print_total_time parse_options_memory_exhausted diff --git a/link-grammar/link-includes.h b/link-grammar/link-includes.h index e326b33..9148ed6 100644 --- a/link-grammar/link-includes.h +++ b/link-grammar/link-includes.h @@ -194,10 +194,12 @@ link_public_api(void) parse_options_set_use_sat_parser(Parse_Options opts, bool use_sat_solver); link_public_api(bool) parse_options_get_use_sat_parser(Parse_Options opts); +#ifdef USE_VITERBI link_public_api(void) parse_options_set_use_viterbi(Parse_Options opts, bool use_viterbi); link_public_api(bool) parse_options_get_use_viterbi(Parse_Options opts); +#endif link_public_api(bool) parse_options_timer_expired(Parse_Options opts); link_public_api(bool) diff --git a/link-grammar/linkage/linkage.c b/link-grammar/linkage/linkage.c index e35ba44..1ec8417 100644 --- a/link-grammar/linkage/linkage.c +++ b/link-grammar/linkage/linkage.c @@ -122,6 +122,28 @@ static Gword *wordgraph_null_join(Sentence sent, Gword **start, Gword **end) return new_word; } +/** + * Add a display wordgraph placeholder for a combined morpheme with links + * that are not discardable. + * This is needed only when hiding morphology. This is a kind of a hack. + * It it is not deemed nice, the "hide morphology" mode should just not be + * used for languages with morphemes which have links that cannot be + * discarded on that mode (like Hebrew). + * Possible FIXME: Currently it is also used by w/ in English. + */ +static Gword *wordgraph_link_placeholder(Sentence sent, Gword *w) +{ + Gword *new_word; + + new_word = gword_new(sent, ""); + new_word->status |= WS_PL; + new_word->label = "PH"; + new_word->start = w->start; + new_word->end = w->end; + + return new_word; +} + /** * The functions defined in this file are primarily a part of the user API * for working with linkages. @@ -134,7 +156,7 @@ static Gword *wordgraph_null_join(Sentence sent, Gword **start, Gword **end) #define SUFFIX_SUPPRESS ("LL") /* suffix links start with this */ #define SUFFIX_SUPPRESS_L 2 /* length of above */ -#define HIDE_MORPHO (!display_morphology) +#define HIDE_MORPHO (('\0' != infix_mark) && !display_morphology) /* TODO? !display_guess_marks is not implemented. */ #define DISPLAY_GUESS_MARKS true // (opts->display_guess_marks) @@ -265,6 +287,7 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) int *remap = alloca(linkage->num_words * sizeof(*remap)); bool *show_word = alloca(linkage->num_words * sizeof(*show_word)); bool display_morphology = opts->display_morphology; + const char infix_mark = INFIX_MARK(sent->dict->affix_table); Gword **lwg_path = linkage->wg_path; Gword **n_lwg_path = NULL; /* new Wordgraph path, to match chosen_words */ @@ -278,6 +301,29 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) if (verbosity_level(D_CCW)) print_lwg_path(lwg_path, "Linkage"); + /* If morphology printing is being suppressed, then all links + * connecting morphemes will be discarded. */ + if (HIDE_MORPHO) + { + /* Discard morphology links. */ + for (i=0; inum_links; i++) + { + Link * lnk = &linkage->link_array[i]; + + if (is_morphology_link(lnk->link_name)) + { + /* Mark link for discarding. */ + lnk->link_name = NULL; + } + else + { + /* Mark word for not discarding. */ + show_word[lnk->rw] = true; + show_word[lnk->lw] = true; + } + } + } + for (i = 0; i < linkage->num_words; i++) { Disjunct *cdj = cdjp[i]; @@ -471,8 +517,23 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) /* 2. Join subscripts. */ for (wgaltp = wgp, m = 0; m < mcnt; wgaltp++, m++) { + Gword *wg_placeholder; + /* Cannot NULLify the word - we may have links to it. */ - if (m != mcnt-1) chosen_words[i+m] = ""; + if (m != mcnt-1) + { + chosen_words[i+m] = ""; + + if (show_word[i+m]) + { + /* We have undiscardable links to this word. + * Add a display wordgraph placeholder so + * get_word_*() will work and return the original + * morpheme positions. */ + wg_placeholder = wordgraph_link_placeholder(sent, *wgaltp); + gwordlist_append(&n_lwg_path, wg_placeholder); + } + } sm = strchr(cdjp[i+m]->word_string, SUBSCRIPT_MARK); @@ -517,7 +578,7 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) (SUBSCRIPT_MARK == join[join_len-1])) join[join_len-1] = '\0'; - gwordlist_append(&n_lwg_path, sentence_word); + gwordlist_append(&n_lwg_path, w->unsplit_word); t = string_set_add(join, sent->string_set); free(join); @@ -578,7 +639,7 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) * a guess indication but the last subword doesn't have, no guess * indication would be shown at all. */ - if ((NULL == regex_name) || HIDE_MORPHO) regex_name = ""; + if ((NULL == regex_name) || !display_morphology) regex_name = ""; s = alloca(strlen(t) + strlen(regex_name) + 4); strncpy(s, t, baselen); s[baselen] = '['; @@ -608,29 +669,6 @@ void compute_chosen_words(Sentence sent, Linkage linkage, Parse_Options opts) } } - /* If morphology printing is being suppressed, then all links - * connecting morphemes will be discarded. */ - if (HIDE_MORPHO) - { - /* Discard morphology links. */ - for (i=0; inum_links; i++) - { - Link * lnk = &linkage->link_array[i]; - - if (is_morphology_link(lnk->link_name)) - { - /* Mark link for discarding. */ - lnk->link_name = NULL; - } - else - { - /* Mark word for not discarding. */ - show_word[lnk->rw] = true; - show_word[lnk->lw] = true; - } - } - } - /* We alloc a little more than needed, but so what... */ linkage->word = (const char **) exalloc(linkage->num_words*sizeof(char *)); @@ -858,19 +896,15 @@ size_t linkage_get_word_byte_end(const Linkage linkage, WordIdx w) size_t linkage_get_word_char_start(const Linkage linkage, WordIdx w) { if (linkage->num_words <= w) return 0; /* bounds-check */ - int pos = linkage->wg_path_display[w]->start - linkage->sent->orig_sentence; - char *sentchunk = alloca(pos+1); - strncpy(sentchunk, linkage->sent->orig_sentence, pos); - sentchunk[pos] = '\0'; + int pos = (int)(linkage->wg_path_display[w]->start - linkage->sent->orig_sentence); + char *sentchunk = strndupa(linkage->sent->orig_sentence, pos); return utf8_strlen(sentchunk); } size_t linkage_get_word_char_end(const Linkage linkage, WordIdx w) { if (linkage->num_words <= w) return 0; /* bounds-check */ - int pos = linkage->wg_path_display[w]->end - linkage->sent->orig_sentence; - char *sentchunk = alloca(pos+1); - strncpy(sentchunk, linkage->sent->orig_sentence, pos); - sentchunk[pos] = '\0'; + int pos = (int)(linkage->wg_path_display[w]->end - linkage->sent->orig_sentence); + char *sentchunk = strndupa(linkage->sent->orig_sentence, pos); return utf8_strlen(sentchunk); } diff --git a/link-grammar/linkage/sane.c b/link-grammar/linkage/sane.c index 3dc96d2..17a1cc8 100644 --- a/link-grammar/linkage/sane.c +++ b/link-grammar/linkage/sane.c @@ -530,7 +530,7 @@ bool sane_linkage_morphism(Sentence sent, Linkage lkg, Parse_Options opts) if (('\0' != affix_types[0]) && (NULL == match_regex(afdict->regex_root, affix_types))) { - /* Morpheme type combination is invalid */ + /* Morpheme type combination is invalid. */ match_found = false; /* Notify to stdout, so it will be shown along with the result. * XXX We should have a better way to notify. */ diff --git a/link-grammar/minisat/LICENSE b/link-grammar/minisat/LICENSE new file mode 100644 index 0000000..22816ff --- /dev/null +++ b/link-grammar/minisat/LICENSE @@ -0,0 +1,21 @@ +MiniSat -- Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson + Copyright (c) 2007-2010 Niklas Sorensson + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/link-grammar/minisat/Makefile.am b/link-grammar/minisat/Makefile.am index 1b833ff..945988f 100644 --- a/link-grammar/minisat/Makefile.am +++ b/link-grammar/minisat/Makefile.am @@ -24,4 +24,4 @@ libminisat_la_SOURCES = \ minisat/utils/System.cc \ minisat/utils/System.h -EXTRA_DIST= README +EXTRA_DIST= README LICENSE diff --git a/link-grammar/minisat/Makefile.in b/link-grammar/minisat/Makefile.in index a7f5d13..a893655 100644 --- a/link-grammar/minisat/Makefile.in +++ b/link-grammar/minisat/Makefile.in @@ -401,7 +401,7 @@ libminisat_la_SOURCES = \ minisat/utils/System.cc \ minisat/utils/System.h -EXTRA_DIST = README +EXTRA_DIST = README LICENSE all: all-am .SUFFIXES: diff --git a/link-grammar/parse/count.c b/link-grammar/parse/count.c index 264ade7..8ceab6e 100644 --- a/link-grammar/parse/count.c +++ b/link-grammar/parse/count.c @@ -417,8 +417,8 @@ static Count_bin do_count( { size_t mlb = form_match_list(mchxt, w, le, lw, re, rw); #ifdef VERIFY_MATCH_LIST - int id = get_match_list_element(mchxt, mlb) ? - get_match_list_element(mchxt, mlb)->match_id : 0; + unsigned int id = get_match_list_element(mchxt, mlb) ? + get_match_list_element(mchxt, mlb)->match_id : 0; #endif for (size_t mle = mlb; get_match_list_element(mchxt, mle) != NULL; mle++) { diff --git a/link-grammar/parse/prune.c b/link-grammar/parse/prune.c index 6e8647b..d5a53da 100644 --- a/link-grammar/parse/prune.c +++ b/link-grammar/parse/prune.c @@ -443,7 +443,7 @@ static bool possible_connection(prune_context *pc, * at least one intervening connector (i.e. cannot have both * lc->next and rc->next being null). But we only enforce this * when we think its still possible to have a complete parse, - * i.e. before well allow null-linked words. + * i.e. before we allow null-linked words. */ else if (!pc->null_links && @@ -486,7 +486,7 @@ right_table_search(prune_context *pc, int w, Connector *c, /** * This returns TRUE if the right table of word w contains - * a connector that can match to c. shallows tells if c is shallow + * a connector that can match to c. shallow tells if c is shallow */ static bool left_table_search(prune_context *pc, int w, Connector *c, @@ -1010,18 +1010,19 @@ static int pp_prune(Sentence sent, Parse_Options opts) { if (!d->marked) continue; deleteme = false; - for (dir = 0; dir < 2; dir++) + for (i = 0; i < knowledge->n_contains_one_rules; i++) { - Connector *c; - for (c = ((dir) ? (d->left) : (d->right)); c != NULL; c = c->next) + pp_rule* rule = &knowledge->contains_one_rules[i]; /* the ith rule */ + const char * selector = rule->selector; /* selector string for this rule */ + pp_linkset * link_set = rule->link_set; /* the set of criterion links */ + + if (rule->selector_has_wildcard) continue; /* If it has a * forget it */ + + for (dir = 0; dir < 2; dir++) { - for (i = 0; i < knowledge->n_contains_one_rules; i++) + Connector *c; + for (c = ((dir) ? (d->left) : (d->right)); c != NULL; c = c->next) { - pp_rule* rule = &knowledge->contains_one_rules[i]; /* the ith rule */ - const char * selector = rule->selector; /* selector string for this rule */ - pp_linkset * link_set = rule->link_set; /* the set of criterion links */ - - if (strchr(selector, '*') != NULL) continue; /* If it has a * forget it */ if (!post_process_match(selector, connector_string(c))) continue; diff --git a/link-grammar/post-process/constituents.c b/link-grammar/post-process/constituents.c index e403f74..d9c6645 100644 --- a/link-grammar/post-process/constituents.c +++ b/link-grammar/post-process/constituents.c @@ -1306,6 +1306,7 @@ char * linkage_print_constituent_tree(Linkage linkage, ConstituentDisplayStyle m CNode * root; if (!linkage) return NULL; + if (!linkage->sent->dict->hpsg_knowledge) return NULL; if (mode == NO_DISPLAY) { return NULL; diff --git a/link-grammar/post-process/pp-structures.h b/link-grammar/post-process/pp-structures.h index 9cb8d57..4da36f1 100644 --- a/link-grammar/post-process/pp-structures.h +++ b/link-grammar/post-process/pp-structures.h @@ -119,6 +119,7 @@ typedef struct pp_rule_s /* Holds a single post-processing rule. Since rules come in many flavors, not all fields of the following are always relevant */ const char *selector; /* name of link to which rule applies */ + bool selector_has_wildcard; /* selector contains '*' */ pp_linkset *link_set; /* handle to set of links relevant to rule */ int link_set_size; /* size of this set */ int domain; /* type of domain to which rule applies */ diff --git a/link-grammar/post-process/pp_knowledge.c b/link-grammar/post-process/pp_knowledge.c index f825c8e..481ab21 100644 --- a/link-grammar/post-process/pp_knowledge.c +++ b/link-grammar/post-process/pp_knowledge.c @@ -26,6 +26,7 @@ #include "pp_linkset.h" #include "string-set.h" #include "dict-common/file-utils.h" // for dictopen +#include "utilities.h" // for free() #define D_PPK 10 /* verbosity level for this file */ #define PP_MAX_UNIQUE_LINK_NAMES 1024 /* just needs to be approximate */ @@ -307,6 +308,7 @@ static bool read_contains_rules(pp_knowledge *k, const char *label, } (*rules)[r].selector = string_set_add(tokens[0], k->string_set); + (*rules)[r].selector_has_wildcard = (strchr(tokens[0], '*') != NULL); /* read link set */ tokens = pp_lexer_get_next_group_of_tokens_of_label(k->lt, &n_tokens); diff --git a/link-grammar/prepare/build-disjuncts.c b/link-grammar/prepare/build-disjuncts.c index 500bc31..56e6279 100644 --- a/link-grammar/prepare/build-disjuncts.c +++ b/link-grammar/prepare/build-disjuncts.c @@ -157,7 +157,7 @@ static Clause * build_clause(Exp *e) { c = (Clause *) xalloc(sizeof (Clause)); c->cost = c3->cost + c4->cost; - c->maxcost = fmaxf(c3->maxcost,c4->maxcost); + c->maxcost = MAX(c3->maxcost,c4->maxcost); c->c = catenate(c3->c, c4->c); c->next = c_head; c_head = c; @@ -212,52 +212,6 @@ static Clause * build_clause(Exp *e) return c; } -// #define DEBUG -#ifdef DEBUG -/* Misc printing functions, useful for debugging */ - -static void print_Tconnector_list(Tconnector * e) -{ - for (;e != NULL; e=e->next) { - if (e->multi) printf("@"); - printf("%s", e->condesc->string); - printf("%c", e->dir); - if (e->next != NULL) printf(" "); - } -} - -GNUC_UNUSED static void print_clause_list(Clause * c) -{ - for (;c != NULL; c=c->next) { - printf(" Clause: "); - printf("(%4.2f, %4.2f) ", c->cost, c->maxcost); - print_Tconnector_list(c->c); - printf("\n"); - } -} - -static void print_connector_list(Connector * e) -{ - for (;e != NULL; e=e->next) - { - printf("%s", connector_string(e)); - if (e->next != NULL) printf(" "); - } -} - -GNUC_UNUSED static void print_disjunct_list(Disjunct * dj) -{ - for (;dj != NULL; dj=dj->next) { - printf("%10s: ", dj->word_string); - printf("(%f) ", dj->cost); - print_connector_list(dj->left); - printf(" <--> "); - print_connector_list(dj->right); - printf("\n"); - } -} -#endif /* DEBUG */ - /** * Build a new list of connectors starting from the Tconnectors * in the list pointed to by e. Keep only those whose strings whose @@ -322,6 +276,49 @@ Disjunct * build_disjuncts_for_exp(Exp* exp, const char *word, } #ifdef DEBUG +/* Misc printing functions, useful for debugging */ + +static void print_Tconnector_list(Tconnector * e) +{ + for (;e != NULL; e=e->next) { + if (e->multi) printf("@"); + printf("%s", e->condesc->string); + printf("%c", e->dir); + if (e->next != NULL) printf(" "); + } +} + +GNUC_UNUSED static void print_clause_list(Clause * c) +{ + for (;c != NULL; c=c->next) { + printf(" Clause: "); + printf("(%4.2f, %4.2f) ", c->cost, c->maxcost); + print_Tconnector_list(c->c); + printf("\n"); + } +} + +static void print_connector_list(Connector * e) +{ + for (;e != NULL; e=e->next) + { + printf("%s", connector_string(e)); + if (e->next != NULL) printf(" "); + } +} + +GNUC_UNUSED static void print_disjunct_list(Disjunct * dj) +{ + for (;dj != NULL; dj=dj->next) { + printf("%10s: ", dj->word_string); + printf("(%f) ", dj->cost); + print_connector_list(dj->left); + printf(" <--> "); + print_connector_list(dj->right); + printf("\n"); + } +} + /* There is a much better print_expression elsewhere * This one is for low-level debug. */ GNUC_UNUSED void prt_exp(Exp *e, int i) @@ -388,4 +385,4 @@ GNUC_UNUSED void prt_exp_mem(Exp *e, int i) printf("con=%s dir=%c multi=%d\n", e->u.condesc->string, e->dir, e->multi); } } -#endif +#endif /* DEBUG */ diff --git a/link-grammar/prepare/exprune.c b/link-grammar/prepare/exprune.c index 3ea97bd..1861365 100644 --- a/link-grammar/prepare/exprune.c +++ b/link-grammar/prepare/exprune.c @@ -422,8 +422,7 @@ void expression_prune(Sentence sent, Parse_Options opts) DBG_EXPSIZES("Initial expression sizes\n%s", e); - int pass = -1; - while (pass++) + for (int pass = 0; ; pass++) { /* Left-to-right pass */ /* For every word */ diff --git a/link-grammar/print/print-util.c b/link-grammar/print/print-util.c index 1734907..584ede9 100644 --- a/link-grammar/print/print-util.c +++ b/link-grammar/print/print-util.c @@ -168,15 +168,21 @@ int vappend_string(dyn_str * string, const char *fmt, va_list args) if (templen >= TMPLEN) { /* TMPLEN is too small - use a bigger buffer. This may happen - * when printing dictionary words using !! with a wildcard. */ - temp_string = alloca(templen+1); + * when printing dictionary words using !! with a wildcard + * or when debug-printing all the connectors. */ + temp_string = malloc(templen+1); templen = vsnprintf(temp_string, templen+1, fmt, args); - if (templen < 0) goto error; + if (templen < 0) + { + free(temp_string); + goto error; + } } va_end(args); patch_subscript_marks(temp_string); dyn_strcat(string, temp_string); + if (templen >= TMPLEN) free(temp_string); return templen; error: @@ -186,7 +192,7 @@ error: strcpy(temp_buffer, msg); strerror_r(errno, temp_buffer+sizeof(msg)-1, TMPLEN-sizeof(msg)); strcat(temp_buffer, "]"); - dyn_strcat(string, temp_string); + dyn_strcat(string, temp_buffer); va_end(args); return templen; } diff --git a/link-grammar/print/print.c b/link-grammar/print/print.c index 1481bbb..cdf1593 100644 --- a/link-grammar/print/print.c +++ b/link-grammar/print/print.c @@ -39,7 +39,7 @@ * By "column widths", it is meant the number of terminal columns * needed to display a glyph. Almost all indoeuropean glyphs are one * column wide. Almost all CJK glyphs (hanzi, kanji) are two columns - * wide. These widths are NOT to be confuxed with UTF-8 byte size. + * wide. These widths are NOT to be confused with UTF-8 byte size. * * FIXME Long link names between more distant words may still not * fit the space between these words. @@ -47,7 +47,7 @@ * Return the number of bytes needed for the all the words, including * the space needed for the link names as described above. Note that * this byte length might be less than the glyph width! e.g. the - * ASCII chars in the rangel 01 to 1F usually print in two columns, + * ASCII chars in the range 01 to 1F usually print in two columns, * but require only one byte to encode. */ static size_t @@ -562,7 +562,7 @@ linkage_print_diagram_ctxt(const Linkage linkage, // be less, or it might be more than the total number of // bytes in the UTF-8 string! Which one depends on just how // much garage there might be in the string. Note also that, - // in general, the glyphy of the last word will stick out past + // in general, the glyph of the last word will stick out past // the num_cols here. unsigned int num_cols = center[N_words_to_print-1]+1; diff --git a/link-grammar/sat-solver/sat-encoder.cpp b/link-grammar/sat-solver/sat-encoder.cpp index 8912c90..96731b3 100644 --- a/link-grammar/sat-solver/sat-encoder.cpp +++ b/link-grammar/sat-solver/sat-encoder.cpp @@ -463,7 +463,7 @@ void SATEncoder::generate_satisfaction_for_expression(int w, int& dfs_position, Exp* SATEncoder::join_alternatives(int w) { - // join all alternatives using and OR_type node + // join all alternatives using an OR_type node Exp* exp; E_list* or_list = NULL;; for (X_node* x = _sent->word[w].x; x != NULL; x = x->next) { @@ -1361,6 +1361,9 @@ void SATEncoder::pp_prune() if (_sent->dict->base_knowledge == NULL) return; + if (!_opts->perform_pp_prune) + return; + pp_knowledge * knowledge; knowledge = _sent->dict->base_knowledge; @@ -1474,11 +1477,6 @@ Linkage SATEncoder::get_next_linkage() linkage = create_linkage(); sane = sane_linkage_morphism(_sent, linkage, _opts); if (!sane) { - /* We cannot elegantly add this linkage to sent->linkges[] - - * to be freed in sentence_delete(), since insane linkages - * must be there with index > num_linkages_post_processed - so - * they remain hidden, but num_linkages_post_processed is an - * arbitrary number. So we must free it here. */ free_linkage_connectors_and_disjuncts(linkage); free_linkage(linkage); free(linkage); @@ -1498,18 +1496,9 @@ Linkage SATEncoder::get_next_linkage() assert(linkage, "No linkage"); - /* - * We cannot expand the linkage array on demand, since the API uses - * linkage pointers, and they would become invalid if realloc() - * changes the address of the memory block. */ -#if 0 - // Expand the linkage array. - int index = _sent->num_linkages_alloced; - _sent->num_linkages_alloced++; - size_t nbytes = _sent->num_linkages_alloced * sizeof(struct Linkage_s); - _sent->lnkages = (Linkage) realloc(_sent->lnkages, nbytes); -#endif /* 0 */ - + /* We cannot expand the linkage array on demand, since the API uses + * linkage pointers, and they would become invalid if realloc() changes + * the address of the memory block. So it is allocated in advance. */ if (NULL == _sent->lnkages) { _sent->num_linkages_alloced = _opts->linkage_limit; @@ -1530,18 +1519,20 @@ Linkage SATEncoder::get_next_linkage() lkg[1].lifo.N_violations = 0; // Perform the rest of the post-processing - do_post_process(_sent->postprocessor, lkg, false); - if (NULL != _sent->postprocessor->violation) { - lkg->lifo.N_violations++; - lkg->lifo.pp_violation_msg = _sent->postprocessor->violation; - lgdebug(+D_SAT, "Postprocessing error: %s\n", lkg->lifo.pp_violation_msg); - } else { - // XXX We cannot maintain num_valid_linkages, because it starts from - // a high number. If we start it from 0, then on value 1 link-parser - // would report "Unique linkage". - //_sent->num_valid_linkages++; + if (NULL != _sent->postprocessor) { + do_post_process(_sent->postprocessor, lkg, false); + if (NULL != _sent->postprocessor->violation) { + lkg->lifo.N_violations++; + lkg->lifo.pp_violation_msg = _sent->postprocessor->violation; + lgdebug(+D_SAT, "Postprocessing error: %s\n", lkg->lifo.pp_violation_msg); + } else { + // XXX We cannot maintain num_valid_linkages, because it starts from + // a high number. If we start it from 0, then on value 1 link-parser + // would report "Unique linkage". + //_sent->num_valid_linkages++; + } + post_process_free_data(&_sent->postprocessor->pp_data); } - post_process_free_data(&_sent->postprocessor->pp_data); linkage_score(lkg, _opts); // if (NULL == _sent->postprocessor->violation && verbosity > 1) @@ -1864,13 +1855,10 @@ bool SATEncoderConjunctionFreeSentences::sat_extract_links(Linkage lkg) /** * Main entry point into the SAT parser. * A note about panic mode: - * The current version of Minisat we use doesn't support timeouts. - * (Minisat >= 2.2 supports timeout.) In addition, currently parsing - * with null words is not supported here. + * - The MiniSAT support for timeout is not yet used (FIXME). + * - Parsing with null links is not supported (FIXME). * So nothing particularly useful happens in a panic mode, and it is * left for the user to disable it. - * Observation: Apparently the panic options somehow may cause an - * immediate failure to find a solution (not checked why). */ extern "C" int sat_parse(Sentence sent, Parse_Options opts) { @@ -1892,7 +1880,6 @@ extern "C" int sat_parse(Sentence sent, Parse_Options opts) delete encoder; } - // Prepare for parsing - extracted for "preparation.c" encoder = new SATEncoderConjunctionFreeSentences(sent, opts); sent->hook = encoder; encoder->encode(); @@ -1922,6 +1909,7 @@ extern "C" int sat_parse(Sentence sent, Parse_Options opts) if (lkg == NULL || k == linkage_limit) { // We don't have a valid linkages among the first linkage_limit ones sent->num_valid_linkages = 0; + sent->num_linkages_found = k; sent->num_linkages_post_processed = k; if (opts->max_null_count > 0) { // The sat solver doesn't support (yet) parsing with nulls. @@ -1931,12 +1919,13 @@ extern "C" int sat_parse(Sentence sent, Parse_Options opts) "parsing with null links.\n"); } } else { - /* We found a valid linkage. - * XXX However, the following setting is wrong, as we actually don't - * know yet the number of linkages... - * If we don't return some large number here, then the - * Command-line client will fail to print all of the possible - * linkages. Work around this by lying... */ + /* We found a valid linkage. However, we actually don't know yet the + * number of linkages, and if we set them too low, the command-line + * client will fail to display all of the possible linkages. Work + * around this by lying... return the maximum number of linkages we + * are going to produce. + * A NULL linkage will be returned by linkage_create() after the last + * linkage is produced to signify that there are no more linkages. */ sent->num_valid_linkages = linkage_limit; sent->num_linkages_post_processed = linkage_limit; } @@ -1955,8 +1944,8 @@ extern "C" Linkage sat_create_linkage(LinkageIdx k, Sentence sent, Parse_Options SATEncoder* encoder = (SATEncoder*) sent->hook; if (!encoder) return NULL; - // linkage index k is: - if (k >= encoder->_sent->num_valid_linkages) // > allocated memory + // linkage index k is: + if (k >= opts->linkage_limit) // > allocated memory return NULL; if(k > encoder->_next_linkage_index) // skips unproduced linkages { diff --git a/link-grammar/sat-solver/word-tag.cpp b/link-grammar/sat-solver/word-tag.cpp index 3308995..a92cac4 100644 --- a/link-grammar/sat-solver/word-tag.cpp +++ b/link-grammar/sat-solver/word-tag.cpp @@ -32,28 +32,23 @@ void WordTag::insert_connectors(Exp* exp, int& dfs_position, if (exp->type == CONNECTOR_type) { dfs_position++; - Connector connector; - connector.multi = exp->multi; - connector.desc = exp->u.condesc; - set_connector_length_limit(&connector, _opts); - switch (exp->dir) { case '+': _position.push_back(_right_connectors.size()); _dir.push_back('+'); _right_connectors.push_back( - PositionConnector(parent_exp, &connector, '+', _word, dfs_position, - exp->cost, cost, leading_right, false, - eps_right, eps_left, word_xnode)); + PositionConnector(parent_exp, exp, '+', _word, dfs_position, + cost, leading_right, false, + eps_right, eps_left, word_xnode, _opts)); leading_right = false; break; case '-': _position.push_back(_left_connectors.size()); _dir.push_back('-'); _left_connectors.push_back( - PositionConnector(parent_exp, &connector, '-', _word, dfs_position, - exp->cost, cost, false, leading_left, - eps_right, eps_left, word_xnode)); + PositionConnector(parent_exp, exp, '-', _word, dfs_position, + cost, false, leading_left, + eps_right, eps_left, word_xnode, _opts)); leading_left = false; break; default: @@ -162,12 +157,9 @@ void WordTag::insert_connectors(Exp* exp, int& dfs_position, } #undef D_IC -void WordTag::find_matches(int w, const condesc_t* C, char dir, std::vector& matches) +void WordTag::find_matches(int w, Connector* search_cntr, char dir, std::vector& matches) { - // cout << "Look connection on: ." << _word << ". ." << w << ". " << C << dir << endl; - Connector search_cntr; - search_cntr.desc = C; - set_connector_length_limit(&search_cntr, _opts); + // cout << "Look connection on: ." << _word << ". ." << w << ". " << search_cntr << dir << endl; std::vector* connectors; switch(dir) { @@ -183,7 +175,7 @@ void WordTag::find_matches(int w, const condesc_t* C, char dir, std::vector::iterator i; for (i = connectors->begin(); i != connectors->end(); i++) { - if (WordTag::match(w, search_cntr, dir, (*i).word, ((*i).connector))) { + if (WordTag::match(w, *search_cntr, dir, (*i).word, ((*i).connector))) { matches.push_back(&(*i)); } } @@ -194,7 +186,7 @@ void WordTag::add_matches_with_word(WordTag& tag) std::vector::iterator i; for (i = _right_connectors.begin(); i != _right_connectors.end(); i++) { std::vector connector_matches; - tag.find_matches(_word, (*i).connector.desc, '+', connector_matches); + tag.find_matches(_word, &(*i).connector, '+', connector_matches); std::vector::iterator j; for (j = connector_matches.begin(); j != connector_matches.end(); j++) { i->matches.push_back(*j); diff --git a/link-grammar/sat-solver/word-tag.hpp b/link-grammar/sat-solver/word-tag.hpp index 2fbb310..dcd0c78 100644 --- a/link-grammar/sat-solver/word-tag.hpp +++ b/link-grammar/sat-solver/word-tag.hpp @@ -8,29 +8,32 @@ extern "C" { #include "connectors.h" #include "dict-common/dict-common.h" +#include "tokenize/tok-structures.h" // gword_set +#include "tokenize/wordgraph.h" // in_same_alternative() }; #include "variables.hpp" struct PositionConnector { - PositionConnector(Exp* e, Connector* c, char d, int w, int p, - double cst, double pcst, bool lr, bool ll, - const std::vector& er, const std::vector& el, const X_node *w_xnode) - : exp(e), dir(d), word(w), position(p), - cost(cst), parent_cost(pcst), + PositionConnector(Exp* pe, Exp* e, char d, int w, int p, + double pcst, bool lr, bool ll, + const std::vector& er, const std::vector& el, const X_node *w_xnode, Parse_Options opts) + : exp(pe), dir(d), word(w), position(p), + cost(e->cost), parent_cost(pcst), leading_right(lr), leading_left(ll), eps_right(er), eps_left(el), word_xnode(w_xnode) { - // Initialize some fields in the connector struct. - connector.desc = c->desc; - connector.multi = c->multi; - connector.length_limit = c->length_limit; - if (word_xnode == NULL) { - cerr << "Internal error: Word" << w << ": " << "; connector: '" << connector_string(c) << "'; X_node: " << (word_xnode?word_xnode->string: "(null)") << endl; + cerr << "Internal error: Word" << w << ": " << "; connector: '" << e->u.condesc->string << "'; X_node: " << (word_xnode?word_xnode->string: "(null)") << endl; } + // Initialize some fields in the connector struct. + connector.desc = e->u.condesc; + connector.multi = e->multi; + set_connector_length_limit(&connector, opts); + connector.originating_gword = &w_xnode->word->gword_set_head; + /* cout << c->string << " : ." << w << ". : ." << p << ". "; if (leading_right) { @@ -145,11 +148,24 @@ public: return NULL; } +#define OPTIMIZE_EN + static bool alt_connectivity_possible(Connector& c1, Connector & c2) + { +#ifdef OPTIMIZE_EN + /* Try a shortcut first. */ + if ((c2.originating_gword->o_gword->hier_depth == 0) || + (c1.originating_gword->o_gword->hier_depth == 0)) return true; +#endif // OPTIMIZE_EN + + return in_same_alternative(c1.originating_gword->o_gword, c2.originating_gword->o_gword); + } + bool match(int w1, Connector& cntr1, char dir, int w2, Connector& cntr2) { int dist = w2 - w1; assert(0 < dist, "match() did not receive words in the natural order."); if (dist > cntr1.length_limit || dist > cntr2.length_limit) return false; + if (!alt_connectivity_possible(cntr1, cntr2)) return false; return easy_match_desc(cntr1.desc, cntr2.desc); } @@ -168,7 +184,7 @@ public: void add_matches_with_word(WordTag& tag); // Find matches in this word tag with the connector (name, dir). - void find_matches(int w, const condesc_t* C, char dir, std::vector& matches); + void find_matches(int w, Connector* C, char dir, std::vector& matches); // A simpler function: Can any connector in this word match a connector wi, pi? // It is assumed that diff --git a/link-grammar/utilities.h b/link-grammar/utilities.h index e1339e5..202818e 100644 --- a/link-grammar/utilities.h +++ b/link-grammar/utilities.h @@ -199,10 +199,6 @@ void *aligned_alloc(size_t alignment, size_t size); #define STR(x) #x #define STRINGIFY(x) STR(x) -#if defined(__UCLIBC__) -#define fmaxf(a,b) ((a) > (b) ? (a) : (b)) -#endif - #if !defined(MIN) #define MIN(X,Y) ( ((X) < (Y)) ? (X) : (Y)) #endif diff --git a/link-parser/command-line.c b/link-parser/command-line.c index b55f58f..9b94c84 100644 --- a/link-parser/command-line.c +++ b/link-parser/command-line.c @@ -238,9 +238,11 @@ static const char *switch_value_string(const Switch *as) snprintf(buf, sizeof(buf), "%d", ival(*as)); break; case String: +#if 0 /* It seems it is not a good idea. */ if ((NULL == *(char **)as->ptr) || ('\0' == **(char **)as->ptr)) - strcpy(buf, " (not set)"); + strcpy(buf, "(not set)"); else +#endif snprintf(buf, sizeof(buf), "%s", *(char **)as->ptr); break; case Cmd: @@ -552,13 +554,13 @@ static int help_cmd(const Switch *uc, int n) printf("Special commands always begin with \"!\". Command and variable names\n"); printf("can be abbreviated. Here is a list of the commands:\n\n"); - printf(" !help command Show a detailed help for the given command\n"); + printf(" !help command Show a detailed help for the given command.\n"); for (int i = 0; uc[i].string != NULL; i++) { if (Cmd != uc[i].param_type) continue; if (UNDOC[0] == uc[i].description[0]) continue; printf(" !%-14s ", uc[i].string); - printf("%s\n", uc[i].description); + printf("%s.\n", uc[i].description); } printf("\n"); @@ -660,6 +662,8 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (((Bool == as[i].param_type) || (Cmd == as[i].param_type)) && strncasecmp(s, as[i].string, strlen(s)) == 0) { + if ((UNDOC[0] == as[i].description[0]) && + (strlen(as[i].string) != strlen(s))) continue; count++; j = i; } @@ -667,7 +671,7 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (count > 1) { - printf("Ambiguous command. Type \"!help\" or \"!variables\"\n"); + prt_error("Ambiguous command \"%s\". Type \"!help\" or \"!variables\"\n", s); return -1; } else if (count == 1) @@ -743,6 +747,8 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (Cmd == as[i].param_type) continue; if (strncasecmp(x, as[i].string, strlen(x)) == 0) { + if ((UNDOC[0] == as[i].description[0]) && + (strlen(as[i].string) != strlen(x))) continue; j = i; count ++; } @@ -750,13 +756,13 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (j<0) { - printf("There is no user variable called \"%s\".\n", x); + prt_error("Error: There is no user variable called \"%s\".\n", x); return -1; } if (count > 1) { - printf("Ambiguous variable. Type \"!help\" or \"!variables\"\n"); + prt_error("Error: Ambiguous variable \"%s\". Type \"!help\" or \"!variables\"\n", x); return -1; } @@ -770,7 +776,7 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (val < 0) { - printf("Invalid value %s for variable %s Type \"!help\" or \"!variables\"\n", y, as[j].string); + prt_error("Error: Invalid value %s for variable \"%s\". Type \"!help\" or \"!variables\"\n", y, as[j].string); return -1; } @@ -783,9 +789,9 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona { char *err; double val = strtod(y, &err); - if ('\0' != *err) + if (('\0' == *y) ||('\0' != *err)) { - printf("Invalid value %s for variable %s Type \"!help\" or \"!variables\"\n", y, as[j].string); + prt_error("Error: Invalid value %s for variable \"%s\". Type \"!help\" or \"!variables\"\n", y, as[j].string); return -1; } @@ -816,6 +822,8 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if ((Bool != as[i].param_type) && (Cmd != as[i].param_type) && strncasecmp(s, as[i].string, strlen(s)) == 0) { + if ((UNDOC[0] == as[i].description[0]) && + (strlen(as[i].string) != strlen(s))) continue; j = i; count++; } @@ -823,11 +831,11 @@ static int x_issue_special_command(char * line, Command_Options *copts, Dictiona if (0 < count) { - printf("Variable \"%s\" requires a value. Try \"!help\".\n", as[j].string); + prt_error("Error: Variable \"%s\" requires a value. Try \"!help\".\n", as[j].string); return -1; } - printf("I can't interpret \"%s\" as a command. Try \"!help\".\n", line); + prt_error("Error: I can't interpret \"%s\" as a command. Try \"!help\".\n", line); return -1; } @@ -848,7 +856,9 @@ static void put_opts_in_local_vars(Command_Options* copts) local.max_cost = parse_options_get_disjunct_cost(opts); local.use_cluster_disjuncts = parse_options_get_use_cluster_disjuncts(opts); local.use_sat_solver = parse_options_get_use_sat_parser(opts); +#ifdef USE_VITERBI local.use_viterbi = parse_options_get_use_viterbi(opts); +#endif local.screen_width = (int)copts->screen_width; local.echo_on = copts->echo_on; @@ -889,7 +899,9 @@ static void put_local_vars_in_opts(Command_Options* copts) #ifdef USE_SAT_SOLVER parse_options_set_use_sat_parser(opts, local.use_sat_solver); #endif +#ifdef USE_VITERBI parse_options_set_use_viterbi(opts, local.use_viterbi); +#endif parse_options_set_display_morphology(opts, local.display_morphology); copts->screen_width = (size_t)local.screen_width; diff --git a/link-parser/link-parser.c b/link-parser/link-parser.c index 7880e16..0d6f13b 100644 --- a/link-parser/link-parser.c +++ b/link-parser/link-parser.c @@ -197,8 +197,8 @@ static void process_linkage(Linkage linkage, Command_Options* copts) else { copts->display_constituents = 0; - fprintf(stderr, "Can't generate constituents.\n"); - fprintf(stderr, "Constituent processing has been turned off.\n"); + prt_error("Error: Can't generate constituents.\n" + "Constituent processing has been turned off.\n"); } } if (copts->display_links) @@ -228,7 +228,8 @@ static void process_linkage(Linkage linkage, Command_Options* copts) } } -static void print_parse_statistics(Sentence sent, Parse_Options opts) +static void print_parse_statistics(Sentence sent, Parse_Options opts, + Command_Options* copts) { if (sentence_num_linkages_found(sent) > 0) { @@ -244,10 +245,13 @@ static void print_parse_statistics(Sentence sent, Parse_Options opts) } else { - fprintf(stdout, "Found %d linkage%s (%d had no P.P. violations)", - sentence_num_linkages_post_processed(sent), - sentence_num_linkages_post_processed(sent) == 1 ? "" : "s", - sentence_num_valid_linkages(sent)); + if ((sentence_num_valid_linkages(sent) > 0) || copts->display_bad) + { + fprintf(stdout, "Found %d linkage%s (%d had no P.P. violations)", + sentence_num_linkages_post_processed(sent), + sentence_num_linkages_post_processed(sent) == 1 ? "" : "s", + sentence_num_valid_linkages(sent)); + } } if (sentence_null_count(sent) > 0) { @@ -295,7 +299,7 @@ static const char *process_some_linkages(FILE *in, Sentence sent, auto_next_linkage = true; } - if (verbosity > 0) print_parse_statistics(sent, opts); + if (verbosity > 0) print_parse_statistics(sent, opts, copts); num_to_query = sentence_num_linkages_post_processed(sent); if (!copts->display_bad) { @@ -446,7 +450,7 @@ static void batch_process_some_linkages(Label label, { if (strstr(test, ",batch_print_parse_statistics,")) { - print_parse_statistics(sent, opts); + print_parse_statistics(sent, opts, copts); } } } @@ -492,16 +496,30 @@ static void setup_panic_parse_options(Parse_Options opts) parse_options_set_spell_guess(opts, 0); } -static void print_usage(char *str, int exit_value) +static int divert_stdio(FILE *from, FILE *to) +{ + const int origfd = dup(fileno(from)); + dup2(fileno(to), fileno(from)); + return origfd; +} + +#if 0 // Unused for now +static void restore_stdio(FILE *from, int origfd) +{ + dup2(fileno(from), origfd); +} +#endif + +static void print_usage(FILE *out, char *str, int exit_value) { Command_Options *copts; - fprintf(stderr, - "Usage: %s [language|dictionary location]\n" - " [-]\n" - " [--version]\n", str); + fprintf(out, "Usage: %s [language|dictionary location]\n" + " [-]\n" + " [--version]\n", str); - fprintf(stderr, "\nSpecial commands are:\n"); + fprintf(out, "\nSpecial commands are:\n"); copts = command_options_create(); + divert_stdio(stdout, stderr); issue_special_command("var", copts, NULL); exit(exit_value); } @@ -600,7 +618,7 @@ int main(int argc, char * argv[]) if ((i < argc) && strcmp("--help", argv[i]) == 0) { - print_usage(argv[0], 0); + print_usage(stdout, argv[0], 0); } for (; i issue_special_command(var, copts, NULL))) - print_usage(argv[0], -1); + print_usage(stderr, argv[0], -1); } else if (i != 1) { prt_error("Fatal error: Unknown argument '%s'.\n", argv[i]); - print_usage(argv[0], -1); + print_usage(stderr, argv[0], -1); } } @@ -677,8 +695,8 @@ int main(int argc, char * argv[]) { if ((argv[i][0] == '-') && (argv[i][1] == '!')) { - if (issue_special_command(argv[i]+1, copts, dict)) - print_usage(argv[0], -1); + if (0 > issue_special_command(argv[i]+1, copts, dict)) + print_usage(stderr, argv[0], -1); } } @@ -752,7 +770,7 @@ int main(int argc, char * argv[]) struct stat statbuf; if ((0 == stat(filename, &statbuf)) && statbuf.st_mode & S_IFDIR) { - fprintf(stderr, "Error: Cannot open %s: %s\n", + prt_error("Error: Cannot open %s: %s\n", filename, strerror(EISDIR)); continue; } @@ -761,8 +779,7 @@ int main(int argc, char * argv[]) if (NULL == input_fh) { - fprintf(stderr, "Error: Cannot open %s: %s\n", - filename, strerror(errno)); + prt_error("Error: Cannot open %s: %s\n", filename, strerror(errno)); input_fh = stdin; continue; } @@ -779,7 +796,7 @@ int main(int argc, char * argv[]) { fflush(stdout); /* Remind the developer this is a test mode. */ - fprintf(stderr, "Warning: Tests enabled: %s\n", test); + prt_error("Warning: Tests enabled: %s\n", test); if (copts->batch_mode) batch_in_progress = true; } } diff --git a/msvc14/LGlib-features.props b/msvc/LGlib-features.props similarity index 100% rename from msvc14/LGlib-features.props rename to msvc/LGlib-features.props diff --git a/msvc14/LinkGrammar.sln b/msvc/LinkGrammar.sln similarity index 90% rename from msvc14/LinkGrammar.sln rename to msvc/LinkGrammar.sln index 9657916..2d0dab5 100644 --- a/msvc14/LinkGrammar.sln +++ b/msvc/LinkGrammar.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25123.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2035 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LinkGrammarJava", "LinkGrammarJava.vcxproj", "{D74DF531-C18E-4988-8A8C-4F23556DEC1B}" ProjectSection(ProjectDependencies) = postProject @@ -28,15 +28,13 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Debug|Win32.ActiveCfg = Debug|Win32 - {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Debug|x64.ActiveCfg = Release|x64 + {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Debug|x64.ActiveCfg = Debug|x64 {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Release|Win32.ActiveCfg = Release|Win32 - {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Release|Win32.Build.0 = Release|Win32 {D74DF531-C18E-4988-8A8C-4F23556DEC1B}.Release|x64.ActiveCfg = Release|x64 {0A6C539A-3140-48BD-865C-05F45637B93B}.Debug|Win32.ActiveCfg = Debug|Win32 {0A6C539A-3140-48BD-865C-05F45637B93B}.Debug|Win32.Build.0 = Debug|Win32 {0A6C539A-3140-48BD-865C-05F45637B93B}.Debug|x64.ActiveCfg = Debug|x64 {0A6C539A-3140-48BD-865C-05F45637B93B}.Debug|x64.Build.0 = Debug|x64 - {0A6C539A-3140-48BD-865C-05F45637B93B}.Debug|x64.Deploy.0 = Debug|x64 {0A6C539A-3140-48BD-865C-05F45637B93B}.Release|Win32.ActiveCfg = Release|Win32 {0A6C539A-3140-48BD-865C-05F45637B93B}.Release|Win32.Build.0 = Release|Win32 {0A6C539A-3140-48BD-865C-05F45637B93B}.Release|x64.ActiveCfg = Release|x64 @@ -45,7 +43,6 @@ Global {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Debug|Win32.Build.0 = Debug|Win32 {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Debug|x64.ActiveCfg = Debug|x64 {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Debug|x64.Build.0 = Debug|x64 - {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Debug|x64.Deploy.0 = Debug|x64 {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Release|Win32.ActiveCfg = Release|Win32 {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Release|Win32.Build.0 = Release|Win32 {532EFF4D-758A-4705-91EE-9A4AC72C017B}.Release|x64.ActiveCfg = Release|x64 @@ -70,4 +67,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7B2D634D-D376-4321-9515-3428ADBD4140} + EndGlobalSection EndGlobal diff --git a/msvc14/LinkGrammar.vcxproj b/msvc/LinkGrammar.vcxproj similarity index 91% rename from msvc14/LinkGrammar.vcxproj rename to msvc/LinkGrammar.vcxproj index 847885a..339c6a0 100644 --- a/msvc14/LinkGrammar.vcxproj +++ b/msvc/LinkGrammar.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -22,24 +22,24 @@ {0A6C539A-3140-48BD-865C-05F45637B93B} LinkGrammar Win32Proj - 8.1 + 10.0.17134.0 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 @@ -98,7 +98,7 @@ - $(GNUREGEX_DIR)\include;..;..\link-grammar;%(AdditionalIncludeDirectories) + $(GNUREGEX_DIR)\include;%(AdditionalIncludeDirectories) _DEBUG;DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false EnableFastChecks @@ -132,7 +132,7 @@ Disabled - $(GNUREGEX_DIR)\include;..;..\link-grammar;%(AdditionalIncludeDirectories) + $(GNUREGEX_DIR)\include;%(AdditionalIncludeDirectories) _DEBUG;DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL @@ -165,7 +165,7 @@ - $(GNUREGEX_DIR)\include;..;..\link-grammar;%(AdditionalIncludeDirectories) + $(GNUREGEX_DIR)\include;%(AdditionalIncludeDirectories) _WINDOWS;_USRDLL;%(PreprocessorDefinitions) CompileAsC @@ -199,7 +199,7 @@ - $(GNUREGEX_DIR)\include;..;..\link-grammar;%(AdditionalIncludeDirectories) + $(GNUREGEX_DIR)\include;%(AdditionalIncludeDirectories) _WINDOWS;_USRDLL;%(PreprocessorDefinitions) MultiThreadedDLL @@ -254,7 +254,6 @@ - @@ -290,6 +289,7 @@ + @@ -346,30 +346,30 @@ Document - Generating ..\link-grammar\link-features.h - ..\link-grammar\link-features.h + Generating link-granmmar\link-features.h + link-grammar\link-features.h %(Identity);..\configure.ac;confvar.bat false - Generating ..\link-grammar\link-features.h - ..\link-grammar\link-features.h + Generating link-granmmar\link-features.h + link-grammar\link-features.h %(Identity);..\configure.ac;confvar.bat false - Generating ..\link-grammar\link-features.h - ..\link-grammar\link-features.h + Generating link-granmmar\link-features.h + link-grammar\link-features.h %(Identity);..\configure.ac;confvar.bat false - Generating ..\link-grammar\link-features.h - ..\link-grammar\link-features.h + Generating link-granmmar\link-features.h + link-grammar\link-features.h %(Identity);..\configure.ac;confvar.bat false confvar $(Configuration) <%(Identity) >%(Outputs) confvar $(Configuration) <%(Identity) >%(Outputs) confvar $(Configuration) <%(Identity) >%(Outputs) confvar $(Configuration) <%(Identity) >%(Outputs) - true - true - true - true + false + false + false + false diff --git a/msvc14/LinkGrammar.vcxproj.filters b/msvc/LinkGrammar.vcxproj.filters similarity index 96% rename from msvc14/LinkGrammar.vcxproj.filters rename to msvc/LinkGrammar.vcxproj.filters index d5e3093..9abf6d6 100644 --- a/msvc14/LinkGrammar.vcxproj.filters +++ b/msvc/LinkGrammar.vcxproj.filters @@ -191,9 +191,6 @@ Header Files - - Header Files - Header Files @@ -341,6 +338,9 @@ Header Files + + Header Files + @@ -350,4 +350,4 @@ Source Files - + \ No newline at end of file diff --git a/msvc14/LinkGrammarExe.vcxproj b/msvc/LinkGrammarExe.vcxproj similarity index 95% rename from msvc14/LinkGrammarExe.vcxproj rename to msvc/LinkGrammarExe.vcxproj index 2f2f5c6..8ba7d0c 100644 --- a/msvc14/LinkGrammarExe.vcxproj +++ b/msvc/LinkGrammarExe.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -33,26 +33,26 @@ {532EFF4D-758A-4705-91EE-9A4AC72C017B} LinkGrammarExe Win32Proj - 8.1 + 10.0.17134.0 Application - v140 + v141 true Application - v140 + v141 true Application - v140 + v141 Application - v140 + v141 diff --git a/msvc14/LinkGrammarExe.vcxproj.filters b/msvc/LinkGrammarExe.vcxproj.filters similarity index 100% rename from msvc14/LinkGrammarExe.vcxproj.filters rename to msvc/LinkGrammarExe.vcxproj.filters diff --git a/msvc14/LinkGrammarJava.vcxproj b/msvc/LinkGrammarJava.vcxproj similarity index 95% rename from msvc14/LinkGrammarJava.vcxproj rename to msvc/LinkGrammarJava.vcxproj index 5a874a9..5e678b6 100644 --- a/msvc14/LinkGrammarJava.vcxproj +++ b/msvc/LinkGrammarJava.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -21,24 +21,24 @@ {D74DF531-C18E-4988-8A8C-4F23556DEC1B} Win32Proj - 8.1 + 10.0.17134.0 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 DynamicLibrary - v140 + v141 diff --git a/msvc14/LinkGrammarJava.vcxproj.filters b/msvc/LinkGrammarJava.vcxproj.filters similarity index 100% rename from msvc14/LinkGrammarJava.vcxproj.filters rename to msvc/LinkGrammarJava.vcxproj.filters diff --git a/msvc14/Local.props b/msvc/Local.props similarity index 100% rename from msvc14/Local.props rename to msvc/Local.props diff --git a/msvc14/MSVC-common.props b/msvc/MSVC-common.props similarity index 87% rename from msvc14/MSVC-common.props rename to msvc/MSVC-common.props index af7df4a..d155031 100644 --- a/msvc14/MSVC-common.props +++ b/msvc/MSVC-common.props @@ -9,6 +9,7 @@ $(CFLAGS);WIN32_LEAN_AND_MEAN;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 4068 + ..;..\link-grammar;. diff --git a/msvc14/Python2.vcxproj b/msvc/Python2.vcxproj similarity index 94% rename from msvc14/Python2.vcxproj rename to msvc/Python2.vcxproj index a1be43e..9304818 100644 --- a/msvc14/Python2.vcxproj +++ b/msvc/Python2.vcxproj @@ -1,5 +1,5 @@  - + Debug @@ -63,9 +63,6 @@ swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar false - - - {0a6c539a-3140-48bd-865c-05f45637b93b} @@ -111,29 +108,29 @@ swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar {4DBD8AF9-67E2-4F55-B8BD-99903151A98C} Win32Proj Python2 - 8.1 + 10.0.17134.0 DynamicLibrary true - v140 + v141 DynamicLibrary false - v140 + v141 true DynamicLibrary true - v140 + v141 DynamicLibrary false - v140 + v141 true @@ -143,22 +140,22 @@ swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar - + - + - + - + diff --git a/msvc14/Python2.vcxproj.filters b/msvc/Python2.vcxproj.filters similarity index 86% rename from msvc14/Python2.vcxproj.filters rename to msvc/Python2.vcxproj.filters index e7ed3cb..ec364e9 100644 --- a/msvc14/Python2.vcxproj.filters +++ b/msvc/Python2.vcxproj.filters @@ -20,11 +20,6 @@ - - - Header Files - - Source Files diff --git a/msvc/Python3.vcxproj b/msvc/Python3.vcxproj new file mode 100644 index 0000000..1eb889a --- /dev/null +++ b/msvc/Python3.vcxproj @@ -0,0 +1,269 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + Document + <nul set/p x="Invoking "& where.exe swig.exe +echo on +cd $(IntDir) +swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar -o lg_python_wrap.cpp "%(FullPath)" +%40echo off + <nul set/p x="Invoking "& where.exe swig.exe +echo on +cd $(IntDir) +swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar -o lg_python_wrap.cpp "%(FullPath)" +%40echo off + <nul set/p x="Invoking "& where.exe swig.exe +echo on +cd $(IntDir) +swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar -o lg_python_wrap.cpp "%(FullPath)" +%40echo off + <nul set/p x="Invoking "& where.exe swig.exe +echo on +cd $(IntDir) +swig.exe -python -outdir $(OutDir) -module clinkgrammar -I..\..\..\link-grammar -o lg_python_wrap.cpp "%(FullPath)" +%40echo off + Generating Python3 wrapper ^& interface + $(IntDir)\lg_python_wrap.cpp;$(OutDir)\clinkgrammar.py + Generating Python3 wrapper ^& interface + $(IntDir)\lg_python_wrap.cpp;$(OutDir)\clinkgrammar.py + Generating Python3 wrapper ^& interface + $(IntDir)\lg_python_wrap.cpp;$(OutDir)\clinkgrammar.py + Generating Python3 wrapper ^& interface + $(IntDir)\lg_python_wrap.cpp;$(OutDir)\clinkgrammar.py + ..\link-grammar\link-includes.h + ..\link-grammar\link-includes.h + ..\link-grammar\link-includes.h + ..\link-grammar\link-includes.h + false + false + false + false + + + + + {0a6c539a-3140-48bd-865c-05f45637b93b} + + + + + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + + + + + Document + echo on & cd $(ProjectDir) & call confvar <%(Identity) >$(OutDir)__init__.py + echo on & cd $(ProjectDir) & call confvar <%(Identity) >$(OutDir)__init__.py + echo on & cd $(ProjectDir) & call confvar <%(Identity) >$(OutDir)__init__.py + echo on & cd $(ProjectDir) & call confvar <%(Identity) >$(OutDir)__init__.py + Generating $(OutDir)__init__.py + Generating $(OutDir)__init__.py + Generating $(OutDir)__init__.py + Generating $(OutDir)__init__.py + $(OutDir)__init__.py + ..\configure.ac;confvar.bat + false + true + $(OutDir)__init__.py + ..\configure.ac;confvar.bat + false + true + $(OutDir)__init__.py + ..\configure.ac;confvar.bat + false + true + $(OutDir)__init__.py + ..\configure.ac;confvar.bat + false + true + false + false + false + false + + + + {B3AF571B-F80D-4A9C-A8C4-29026316A000} + Win32Proj + Python3 + 10.0.17134.0 + + + + DynamicLibrary + true + v141 + + + DynamicLibrary + false + v141 + true + + + DynamicLibrary + true + v141 + + + DynamicLibrary + false + v141 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + _clinkgrammar + .pyd + Temp\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + + + true + _clinkgrammar + .pyd + Temp\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + + + false + _clinkgrammar + .pyd + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + Temp\$(ProjectName)\ + + + false + _clinkgrammar + .pyd + Temp\$(ProjectName)\ + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + + + + + + Level3 + Disabled + SWIG_PYTHON_INTERPRETER_NO_DEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + + + Console + true + $(SolutionDir)$(Platform)\$(Configuration)\link-grammar-x86.lib;$(PYTHON3_LIB);%(AdditionalDependencies) + UseFastLinkTimeCodeGeneration + + + + + + + Level3 + Disabled + SWIG_PYTHON_INTERPRETER_NO_DEBUG;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + false + + + Console + true + $(SolutionDir)$(Platform)\$(Configuration)\link-grammar-x64.lib;$(PYTHON3_LIB);%(AdditionalDependencies) + Default + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + Speed + true + + + Console + true + true + true + $(SolutionDir)$(Platform)\$(Configuration)\link-grammar-x86.lib;$(PYTHON3_LIB);%(AdditionalDependencies) + UseLinkTimeCodeGeneration + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..;$(PYTHON3_INCLUDE);%(AdditionalIncludeDirectories) + Speed + true + + + Console + true + true + true + $(SolutionDir)$(Platform)\$(Configuration)\link-grammar-x64.lib;$(PYTHON3_LIB);%(AdditionalDependencies) + UseLinkTimeCodeGeneration + + + + + + \ No newline at end of file diff --git a/msvc14/Python3.vcxproj.filters b/msvc/Python3.vcxproj.filters similarity index 86% rename from msvc14/Python3.vcxproj.filters rename to msvc/Python3.vcxproj.filters index 345e1f8..b19bd20 100644 --- a/msvc14/Python3.vcxproj.filters +++ b/msvc/Python3.vcxproj.filters @@ -20,14 +20,9 @@ - - - Header Files - - Source Files - + \ No newline at end of file diff --git a/msvc14/README.md b/msvc/README.md similarity index 95% rename from msvc14/README.md rename to msvc/README.md index 3cec67c..150e4f5 100644 --- a/msvc14/README.md +++ b/msvc/README.md @@ -4,7 +4,7 @@ Note: See also [BUILDING on Windows](/README.md#building-on-windows) in the main README. This directory contains project files for building Link Grammar with the -Microsoft Visual Studio 2015 IDE (MSVC14). They were created and tested with +Microsoft Visual Studio 2017 IDE (MSVC15). They were created and tested with the Community Edition of that product. **!!!WARNING!!!** @@ -142,10 +142,10 @@ BTW, when running and MSVC-compiled binary under Cygwin, don't exit link-parser by using `^Z` - the shell may get stuck because the program somehow may continue to run in the background. Instead, exit using `!exit` . -NOTE: The created DLLs need the MSVC14 runtime environment to run. This is +NOTE: The created DLLs need the MSVC15 runtime environment to run. This is normally already installed in your machine with the installation of the IDE. But to be able to run Link Grammar on other computer you need to install -[Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145). +[Visual C++ Redistributable for Visual Studio 2017](https://visualstudio.microsoft.com/downloads/). This redistributable does not contain debug version of the MSVC runtime, so only "Release" Link Grammar will work with it. diff --git a/msvc14/confvar.bat b/msvc/confvar.bat similarity index 100% rename from msvc14/confvar.bat rename to msvc/confvar.bat diff --git a/msvc14/make-check.py b/msvc/make-check.py similarity index 100% rename from msvc14/make-check.py rename to msvc/make-check.py diff --git a/msvc14/post-build.bat b/msvc/post-build.bat similarity index 100% rename from msvc14/post-build.bat rename to msvc/post-build.bat -- 2.20.1