diff --git a/ChangeLog b/ChangeLog
index 93a652eff5e8fbe98d6b04e366d73c5b76681579..ab902f319d01c1158954a34db18c15ad4419687b 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 19a3a195d654d6cedefcf9c1f76c07a66c294161..c4cde07295a71235cf50573b0eb5d24750a0bb70 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 7c9ecb809d8f638d894fcf6d13dbab2686bb7169..d2155d3360c98fab283e8420a701e42f9d2d6f3d 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 cd4ef020f473d40f1ae68af9d73bb69f6252d631..4d2a4e76d9d3d314e8478f79666bfa2beb3a687b 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 62c777c3a9bef90db5c455cfbba3e2b58d9cc581..ebabb8aa90c1b9df4b8af32bffee315e38e12120 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 5d6ac5d22431aab2d43fe2095acc88af73402dcc..646a51cc72c607845dc009e06c0534bf627deea4 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 b4204c0579302324f19377c0a2e31f80a3358fdf..90a733be95e641580cb82e24a0b39bd80a2f1143 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 49f665a8f0eeacd874205a09294875f243b245f4..091f7791cb071c6a54f26b5d88d6316adceaeeaa 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 13bb8e0c6fd887cfd391589005c387b0904d965c..baacfbffc73c436d8ee857c65101c850f59d95a1 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 08b6aad2314636fdb0acf404ccc810365a63259b..7ef3ac8ea22cad826335f4fd2544e0327e5c5164 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 ff0734c30429d35b04fa9f3a0bb56ddf6f2484b3..2f6a42ce1a7112f12d42d26bb57b00ea56572ee0 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 8bd057d4871e1ea52677e2719fb9d7a7967d61e1..ed2c29a61e82c22444e380c18e662dd793566aee 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 0000000000000000000000000000000000000000..3d7e586e97d260d5d8e8056ddc96d414fb083745
--- /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 f5f05a980f02b441dcf740bbefa597d1c23afa5a..253351fc0dd53e6c3ac38a8f7295e75f83fe32a6 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 0000000000000000000000000000000000000000..9b8cda77f43ada95054cbab398a142b9a504ac4b
--- /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 0000000000000000000000000000000000000000..09e1a50f129c1481fda6f270dafd710f17bcbcff
--- /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 0000000000000000000000000000000000000000..45f7a05effbab85e8b6eb4c19c99ae058323cad9
--- /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 0000000000000000000000000000000000000000..d0c574401e6803162c485523be558fec399ebe28
--- /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 3eb1de9b865c322ccbdb3db515c48ad63626241e..da380cdc115324cfa7eff6742c763b41bcbe6dc0 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 90b6591fda2d492322f4de4ff9b6f788faf69807..c12b080cd4191b5dec73717656245a82360c5f46 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 d509846d799f2ab6973aeca0af3c53c722d3c0f8..81e9d53ce51a3c6fe9b867f0de3dca92f05cc569 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 d201c596cb01a3785ac0e783b7758953d0a0c9d2..ed3e2d520ab7341c0d02f483b45131f6d000dcce 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 7fa6da092672057b9d6c3047257478a2c3260a29..540ed4cecae393dc24a502719dc09563b2c2afa1 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 b5f992c89ebb40c38d1fa0697ec46f54ffa5e34f..b6a24e7a49b113e2dd8033f0df2b65f436327ee7 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 2bf5f57a3b3e3d4520dde4d39769f481ce074693..c2a99cd6fb349d5c46ff109ef0bcb18fe2682fc4 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 d201c596cb01a3785ac0e783b7758953d0a0c9d2..ed3e2d520ab7341c0d02f483b45131f6d000dcce 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 eb2438aba2dbf9836af85e0ae116c412352388c8..0fd4dcce30731af4dc29d42605576ec373f59c40 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 b5f992c89ebb40c38d1fa0697ec46f54ffa5e34f..b6a24e7a49b113e2dd8033f0df2b65f436327ee7 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 9edd47994aa51a08007325ef5fac1e6fd111c2d0..15b1221ba4fd21c84fd9523cb3ad30742b5abb34 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 46b58e397374b0aa61b32a6f79fc0d4a385f2f5b..cadb90e69255f630877d0ae2d4bc72369c6158dd 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 59d3cdf5b9c9244e0a45f9fe13211d2474c69b31..cb6de054021eabe6de5adce7f804e1037b30da36 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 a1d1c3cccd29287e36438a2e90865b849cd49028..eec617de21014038a9b908e1fbce4714d6bd6cd6 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 3b10d92fb612cccaccba73fd9572ef24a4a500d7..2886274b28f7bfc07f89bb13e7dbff080017e9f8 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 bf533b757612631bc5448754e5bb8d8823ca79f5..cf87e81cd7abc75d6de2494b4288fe050a68d17f 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
Binary files a/data/demo-sql/dict.db and b/data/demo-sql/dict.db differ
diff --git a/data/en/4.0.affix b/data/en/4.0.affix
index d972c97c89d50fdd400dd2d276cc46825a1f79ff..746e3209422d8e1e0d13b149dedbec8fed8e5c9d 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 19b78160a383f7f34ec458713778048f1f4fbcc9..118e2e1654a505c3b67a802464545b1bf4afb7ee 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