[cg3] 01/03: Imported Upstream version 0.9.9~r10195

Tino Didriksen tinodidriksen-guest at moszumanska.debian.org
Tue Oct 7 14:43:53 UTC 2014


This is an automated email from the git hooks/post-receive script.

tinodidriksen-guest pushed a commit to branch master
in repository cg3.

commit 851c2b19f5cc69cd95e9ef189f6bf059ac22370e
Author: Tino Didriksen <mail at tinodidriksen.com>
Date:   Tue Oct 7 14:39:30 2014 +0000

    Imported Upstream version 0.9.9~r10195
---
 ChangeLog                          | 148 +++++++++++++++++--------------------
 src/GrammarApplicator.hpp          |   2 +-
 src/GrammarApplicator_matchSet.cpp |  32 ++++----
 src/GrammarApplicator_runRules.cpp |   6 +-
 src/TagTrie.hpp                    |  14 ++++
 src/version.hpp                    |   2 +-
 6 files changed, 103 insertions(+), 101 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 96394b0..112d733 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,74 @@
+2014-10-07  tino
+
+	* [r10194] ChangeLog, src/GrammarApplicator.hpp,
+	  src/GrammarApplicator_matchSet.cpp,
+	  src/GrammarApplicator_runRules.cpp, src/TagTrie.hpp,
+	  src/version.hpp: Fix tag unification to actually work with new
+	  trie storage
+
+2014-10-06  tino
+
+	* [r10190] src/version.hpp: Version bump & change
+
+2014-10-03  tino
+
+	* [r10184] src/CMakeLists.txt: No need to explicitly set rpath any
+	  longer
+
+2014-09-30  tino
+
+	* [r10157] TODO, src/CMakeLists.txt: Eliminate private library
+	  split
+
+2014-09-08  tino
+
+	* [r10134] src/FSTApplicator.cpp: cg-conv FST: Copy wordform ->
+	  baseform when missing
+
+2014-09-05  tino
+
+	* [r10125] src/FSTApplicator.cpp: cg-conv FST input < fix
+	* [r10123] CMakeLists.txt: RPM building fixes
+	* [r10122] CMakeLists.txt, get-boost.sh, src/CMakeLists.txt: RPM
+	  building fixes
+
+2014-09-01  tino
+
+	* [r10105] TODO, src/FSTApplicator.cpp, src/TextualParser.cpp,
+	  src/inlines.hpp: cg-conv FST input now handles trailing
+	  whitespace and \
+
+2014-08-27  tino
+
+	* [r10100] src/cg_conv.cpp: cg-conv: add dummy tag to delimiters to
+	  silence warning
+
+2014-08-23  tino
+
+	* [r10098] TODO, manual/tags.xml: ToDos; Undocument !tag
+
+2014-08-23  unhammer
+
+	* [r10097] emacs/cg.el: highlight SETVARIABLE
+
+2014-08-14  tino
+
+	* [r10080] TODO, manual/installation.xml, manual/probabilistic.xml,
+	  manual/tags.xml, src/GrammarApplicator_matchSet.cpp,
+	  src/NicelineApplicator.cpp, src/Tag.cpp, src/Tag.hpp: Tag prefix
+	  ! is now an alias for ^; cg-conv better handling of niceline
+	  format
+
+2014-08-11  tino
+
+	* [r10072] src/cg_conv.cpp: Better Apertium format detection
+
 2014-08-07  tino
 
+	* [r10065] newsletters/2014-08-07.txt: Newsletter
+	* [r10063] ChangeLog, src/GrammarApplicator_runRules.cpp,
+	  src/version.hpp: Fix setting parent to 0 and later testing for
+	  parent; Release 0.9.8.10063
 	* [r10054] src/TextualParser.cpp: VC10 needs a cast here
 
 2014-07-20  tino
@@ -2423,82 +2492,3 @@
 	  src/main.cpp, test/T_RegExp/grammar.txt: Almost correct ANTLR BNF
 	  grammar of CG-3
 
-2011-10-02  tino
-
-	* [r7577] scripts/cg3-autobin.pl,
-	  src/GrammarApplicator_runRules.cpp, src/version.h: Segfault
-	  workaround
-
-2011-09-05  tino
-
-	* [r7490] manual/rules.xml, manual/streamcmds.xml, manual/tags.xml:
-	  Documented variables
-	* [r7489] scripts/cg3-autobin.pl, src/GrammarApplicator.cpp,
-	  src/GrammarApplicator.h, src/GrammarApplicator_matchSet.cpp,
-	  src/GrammarApplicator_runGrammar.cpp,
-	  src/GrammarApplicator_runRules.cpp, src/Rule.h,
-	  src/SingleWindow.h, src/Strings.cpp, src/Strings.h, src/Tag.cpp,
-	  src/TextualParser.cpp, src/version.h,
-	  test/T_Variables/byline.txt, test/T_Variables/expected.txt,
-	  test/T_Variables/grammar.txt, test/T_Variables/input.txt:
-	  Partially implemented variables
-
-2011-09-02  tino
-
-	* [r7478] TODO, scripts/cg3-autobin.pl, src/main.cpp,
-	  src/version.h: cg3
-
-2011-08-25  tino
-
-	* [r7465] scripts/cg3-autobin.pl, src/GrammarApplicator.cpp,
-	  src/version.h, test/T_InputMarkup/expected.txt,
-	  test/T_InputMarkup/grammar.txt: Fixed RemCohort of the last
-	  cohort to still output text from the cohorts.
-	* [r7464] TODO, scripts/cg3-autobin.pl,
-	  src/GrammarApplicator_runRules.cpp, src/version.h,
-	  test/T_BasicAppend/expected.txt, test/T_BasicAppend/grammar.txt,
-	  test/T_BasicAppend/input.txt: Append can now append multiple
-	  readings in one line. Noprint/magic readings are removed after
-	  append. Noprint/magic readings are added after unsafe remove.
-
-2011-08-11  tino
-
-	* [r7436] manual/parentheses.xml, scripts/cg3-autobin.pl,
-	  src/GrammarApplicator_runGrammar.cpp,
-	  src/GrammarApplicator_runRules.cpp, src/Tag.cpp, src/main.cpp,
-	  src/version.h: Memory fixes
-	* [r7434] manual/faq.xml, scripts/cg3-autobin.pl,
-	  src/ContextualTest.h, src/GrammarApplicator.h,
-	  src/GrammarApplicator_matchSet.cpp,
-	  src/GrammarApplicator_runContextualTest.cpp, src/Strings.cpp,
-	  src/Strings.h, src/Tag.cpp, src/Tag.h, src/TextualParser.cpp,
-	  src/version.h, test/T_Parentheses/expected.txt,
-	  test/T_Parentheses/grammar.txt, test/T_Parentheses/run.pl:
-	  Implemented _ENCL_; WIP on reading-level dependency.
-	* [r7433] src/GrammarApplicator_runRules.cpp,
-	  test/T_External/expected.txt, test/T_External/grammar.txt: cg3
-
-2011-08-10  tino
-
-	* [r7432] test/T_External/expected.txt: cg3
-	* [r7431] test/T_External/expected.txt,
-	  test/T_External/grammar.txt, test/T_External/rules.inc: cg3
-	* [r7430] scripts/cg3-autobin.pl,
-	  src/GrammarApplicator_runRules.cpp, src/main.cpp, src/version.h:
-	  Fix rules after external
-
-2011-08-05  tino
-
-	* [r7426] scripts/cg3-autobin.pl, src/version.h: cg3
-	* [r7425] src/GrammarApplicator.cpp,
-	  src/GrammarApplicator_runRules.cpp, src/Reading.h,
-	  src/libcg3.cpp, test/T_NumericalTags/expected.txt,
-	  test/T_Unification/expected.txt: Changed ReadingList to a vector;
-	  1% faster, and easier to work with.
-	* [r7424] cmake.sh, manual/installation.xml: CMake fixes
-
-2011-08-04  tino
-
-	* [r7423] manual/faq.xml, scripts/cg3-autobin.pl, src/main.cpp,
-	  src/version.h: Silenced CG-3 unless -v is on.
-
diff --git a/src/GrammarApplicator.hpp b/src/GrammarApplicator.hpp
index d374e3a..69d704b 100644
--- a/src/GrammarApplicator.hpp
+++ b/src/GrammarApplicator.hpp
@@ -171,7 +171,7 @@ namespace CG3 {
 		typedef bc::flat_map<uint32_t,Reading*> readings_plain_t;
 		readings_plain_t readings_plain;
 
-		typedef uint32Map unif_tags_t;
+		typedef bc::flat_map<uint32_t, const void*> unif_tags_t;
 		bc::flat_map<uint32_t,unif_tags_t*> unif_tags_rs;
 		std::vector<unif_tags_t> unif_tags_store;
 		bc::flat_map<uint32_t, uint32SortedVector*> unif_sets_rs;
diff --git a/src/GrammarApplicator_matchSet.cpp b/src/GrammarApplicator_matchSet.cpp
index 980fb10..f85da50 100644
--- a/src/GrammarApplicator_matchSet.cpp
+++ b/src/GrammarApplicator_matchSet.cpp
@@ -438,14 +438,14 @@ bool GrammarApplicator::doesSetMatchReading_trie(const Reading& reading, const S
 			if (kv.first->type & T_FAILFAST) {
 				continue;
 			}
-			if (unif_mode) {
-				BOOST_AUTO(it, unif_tags->find(theset.hash));
-				if (it != unif_tags->end() && it->second != kv.first->hash) {
-					continue;
-				}
-				(*unif_tags)[theset.hash] = kv.first->hash;
-			}
 			if (kv.second.terminal) {
+				if (unif_mode) {
+					BOOST_AUTO(it, unif_tags->find(theset.hash));
+					if (it != unif_tags->end() && it->second != &kv) {
+						continue;
+					}
+					(*unif_tags)[theset.hash] = &kv;
+				}
 				return true;
 			}
 			if (kv.second.trie && doesSetMatchReading_trie(reading, theset, *kv.second.trie, unif_mode)) {
@@ -483,15 +483,15 @@ bool GrammarApplicator::doesSetMatchReading_tags(const Reading& reading, const S
 		uint32SortedVector::const_iterator oiter = reading.tags_plain.lower_bound(theset.trie.begin()->first->hash);
 		while (oiter != reading.tags_plain.end() && iiter != theset.trie.end()) {
 			if (*oiter == iiter->first->hash) {
-				if (unif_mode) {
-					BOOST_AUTO(it, unif_tags->find(theset.hash));
-					if (it != unif_tags->end() && it->second != *oiter) {
-						++iiter;
-						continue;
-					}
-					(*unif_tags)[theset.hash] = *oiter;
-				}
 				if (iiter->second.terminal) {
+					if (unif_mode) {
+						BOOST_AUTO(it, unif_tags->find(theset.hash));
+						if (it != unif_tags->end() && it->second != &*iiter) {
+							++iiter;
+							continue;
+						}
+						(*unif_tags)[theset.hash] = &*iiter;
+					}
 					retval = true;
 					break;
 				}
@@ -646,7 +646,7 @@ bool GrammarApplicator::doesSetMatchReading(const Reading& reading, const uint32
 		}
 		// Propagate unified tag to other sets of this set, if applicable
 		if (unif_mode || (theset.type & ST_TAG_UNIFY)) {
-			uint32_t tag = 0;
+			const void *tag = 0;
 			for (size_t i=0 ; i<size ; ++i) {
 				BOOST_AUTO(it, unif_tags->find(theset.sets[i]));
 				if (it != unif_tags->end()) {
diff --git a/src/GrammarApplicator_runRules.cpp b/src/GrammarApplicator_runRules.cpp
index adc1a75..c095a3c 100644
--- a/src/GrammarApplicator_runRules.cpp
+++ b/src/GrammarApplicator_runRules.cpp
@@ -129,10 +129,8 @@ TagList GrammarApplicator::getTagList(const Set& theSet, bool unif_mode) const {
 	else if (unif_mode) {
 		BOOST_AUTO(iter, unif_tags->find(theSet.hash));
 		if (iter != unif_tags->end()) {
-			uint32_t ihash = iter->second;
-			if (single_tags.find(ihash) != single_tags.end()) {
-				theTags.push_back(single_tags.find(ihash)->second);
-			}
+			trie_getTagList(theSet.trie, theTags, iter->second);
+			trie_getTagList(theSet.trie_special, theTags, iter->second);
 		}
 	}
 	else {
diff --git a/src/TagTrie.hpp b/src/TagTrie.hpp
index 9d32107..1a0396e 100644
--- a/src/TagTrie.hpp
+++ b/src/TagTrie.hpp
@@ -120,6 +120,20 @@ namespace CG3 {
 		}
 	}
 
+	inline bool trie_getTagList(const trie_t& trie, TagList& theTags, const void *node) {
+		boost_foreach (const trie_t::value_type& kv, trie) {
+			theTags.push_back(kv.first);
+			if (node == &kv) {
+				return true;
+			}
+			if (kv.second.trie && trie_getTagList(*kv.second.trie, theTags, node)) {
+				return true;
+			}
+			theTags.pop_back();
+		}
+		return false;
+	}
+
 	inline void trie_getTagList(const trie_t& trie, TagVector& theTags) {
 		boost_foreach (const trie_t::value_type& kv, trie) {
 			theTags.push_back(kv.first);
diff --git a/src/version.hpp b/src/version.hpp
index 94cbccd..bf5c14f 100644
--- a/src/version.hpp
+++ b/src/version.hpp
@@ -30,7 +30,7 @@ const char* const CG3_COPYRIGHT_STRING = "Copyright (C) 2007-2014 GrammarSoft Ap
 const uint32_t CG3_VERSION_MAJOR = 0;
 const uint32_t CG3_VERSION_MINOR = 9;
 const uint32_t CG3_VERSION_PATCH = 9;
-const uint32_t CG3_REVISION = 10190;
+const uint32_t CG3_REVISION = 10195;
 const uint32_t CG3_FEATURE_REV = 10043;
 const uint32_t CG3_TOO_OLD = 10043;
 const uint32_t CG3_EXTERNAL_PROTOCOL = 7226;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cg3.git



More information about the debian-science-commits mailing list