[irstlm] 23/126: added supporting functions

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:41 UTC 2016


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

giuliopaci-guest pushed a commit to annotated tag adaptiveLM.v0.1
in repository irstlm.

commit bcb174a3360eb4fd661519ff02097e244dc2bb8d
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Wed Jul 22 18:18:48 2015 +0200

    added supporting functions
---
 src/n_gram.cpp | 12 +++++++++++-
 src/n_gram.h   |  4 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/n_gram.cpp b/src/n_gram.cpp
index 276e6bc..01d736b 100644
--- a/src/n_gram.cpp
+++ b/src/n_gram.cpp
@@ -150,7 +150,6 @@ ifstream& operator>> ( ifstream& fi , ngram& ng)
 	
 }
 
-
 int ngram::pushw(const char* w)
 {
 	
@@ -169,6 +168,17 @@ int ngram::pushw(const char* w)
 	
 }
 
+int ngram::pushw(std::string w){
+	return pushw(w.c_str());
+}
+
+int ngram::pushw(std::vector<std::string> w_vec){
+	for (std::vector<std::string>::iterator it=w_vec.begin(); it != w_vec.end(); ++it){
+		pushw(*it);
+	}
+	return 1;
+}
+
 int ngram::pushc(int c)
 {
 	
diff --git a/src/n_gram.h b/src/n_gram.h
index ccfa85c..1fb3cab 100644
--- a/src/n_gram.h
+++ b/src/n_gram.h
@@ -119,7 +119,9 @@ public:
   int pushc(int c);
   int pushc(int* codes, int sz);
   int pushw(const char* w);
-
+  int pushw(std::string w);
+  int pushw(std::vector<std::string> w_vec);
+	
   //~ngram();
 };
 

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



More information about the debian-science-commits mailing list