[irstlm] 103/126: code optimization and cleanup

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:50 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 ee6e521c471ef46fb6c571a23428ac8f479a4d95
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Tue Sep 22 12:30:41 2015 +0200

    code optimization and cleanup
---
 src/lmContextDependent.cpp |  1 -
 src/lmContextDependent.h   | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/lmContextDependent.cpp b/src/lmContextDependent.cpp
index 54b7bcf..fb47c6e 100644
--- a/src/lmContextDependent.cpp
+++ b/src/lmContextDependent.cpp
@@ -176,7 +176,6 @@ namespace irstlm {
 	{
 		VERBOSE(2,"lmContextDependent::lprob(ngram& ng, topic_map_t& topic_weights, ...)" << std::endl);
 		double lm_logprob = m_lm->clprob(ng, bow, bol, maxsuffptr, statesize, extendible);
-//		double similarity_score = 1.0;
 		double similarity_score = m_similaritymodel->context_similarity(text, topic_weights);
 		double ret_logprob = lm_logprob + m_similaritymodel_weight * similarity_score;
 		VERBOSE(3, "lm_log10_pr:" << lm_logprob << " similarity_score:" << similarity_score << " m_similaritymodel_weight:" << m_similaritymodel_weight << " ret_log10_pr:" << ret_logprob << std::endl);
diff --git a/src/lmContextDependent.h b/src/lmContextDependent.h
index 58c5e1e..ea5a6c0 100644
--- a/src/lmContextDependent.h
+++ b/src/lmContextDependent.h
@@ -158,6 +158,20 @@ namespace irstlm {
 		double total_clprob(string_vec_t& text, topic_map_t& topic_weights);
 		double total_clprob(ngram& ng, topic_map_t& topic_weights);		
 		
+		
+		
+		virtual inline int get(ngram& ng) {
+			return m_lm->get(ng);
+		}
+		
+		virtual int get(ngram& ng,int n,int lev){
+			return m_lm->get(ng,n,lev);
+		}
+		
+		virtual int succscan(ngram& h,ngram& ng,LMT_ACTION action,int lev){
+			return m_lm->succscan(h,ng,action,lev);
+		}
+		
 		int maxlevel() const {
 			return maxlev;
 		};

-- 
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