Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 May 2016 18:44:48 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r414881 - in branches/2016Q2/chinese/sunpinyin: . files
Message-ID:  <201605091844.u49IimlN081360@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim (src committer)
Date: Mon May  9 18:44:48 2016
New Revision: 414881
URL: https://svnweb.freebsd.org/changeset/ports/414881

Log:
  MFH: r414787
  
  During the exp-run in bug 208158, it was found that chinese/sunpinyin
  gives errors with libc++ 3.8.0:
  
  gmake[2]: Entering directory '/wrkdirs/usr/ports/chinese/sunpinyin/work'
  slmpack lm_sc.3gm.arpa dict.utf8 lm_sc.3gm
  Loading lexicon...done.
  Loading ARPA slm...
  Writing out...done!
  slmthread lm_sc.3gm lm_sc.t3g.orig
  Loading original slm...
  first pass...
  Compressing pr values...65536 float values ==> 65536 values
  Compressing bow values...16384 float values ==> 16384 values
  Threading the new model...Assertion failed: (prit != pr_map.end()), function main, file src/slm/thread/slmthread.cpp, line 364.
  /wrkdirs/usr/ports/chinese/sunpinyin/work/sunpinyin-a8bd811/src/sunpinyin-dictgen.mk:51: recipe for target 'lm_sc.t3g.orig' failed
  
  This is because the code mostly uses floats, but in some parts it uses
  log(), exp(), etc, which return doubles.  During the parts where it does
  lookups in std::map<float, int> constructs, this leads to it not being
  able to find the expected entries.  Fix this by using logf(), expf() and
  similar, which explicitly return floats.
  
  Approved by:	portmgr (junovitch)
  PR:		209369

Added:
  branches/2016Q2/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp
     - copied unchanged from r414787, head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp
Modified:
  branches/2016Q2/chinese/sunpinyin/Makefile
Directory Properties:
  branches/2016Q2/   (props changed)

Modified: branches/2016Q2/chinese/sunpinyin/Makefile
==============================================================================
--- branches/2016Q2/chinese/sunpinyin/Makefile	Mon May  9 18:41:02 2016	(r414880)
+++ branches/2016Q2/chinese/sunpinyin/Makefile	Mon May  9 18:44:48 2016	(r414881)
@@ -3,6 +3,7 @@
 
 PORTNAME=	sunpinyin
 DISTVERSION=	2.0.4rc3
+PORTREVISION=	1
 CATEGORIES=	chinese devel
 MASTER_SITES=	GH:1 SF/open-gram:2
 DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:1 \

Copied: branches/2016Q2/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp (from r414787, head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q2/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp	Mon May  9 18:44:48 2016	(r414881, copy of r414787, head/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp)
@@ -0,0 +1,17 @@
+--- src/slm/thread/slmthread.cpp.orig	2014-11-14 14:17:48 UTC
++++ src/slm/thread/slmthread.cpp
+@@ -250,10 +250,10 @@ main(int argc, char* argv[])
+ 
+     bool usingLogPr = slm.isUseLogPr();
+ 
+-    #define EffectivePr(a)  (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a)))))
+-    #define OriginalPr(b)   (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b)))))
+-    #define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a))))
+-    #define OriginalBow(b)  (float((usingLogPr) ? (-log((b))) : ((b))))
++    #define EffectivePr(a)  (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a)))))
++    #define OriginalPr(b)   (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b)))))
++    #define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a))))
++    #define OriginalBow(b)  (float((usingLogPr) ? (-logf((b))) : ((b))))
+ 
+     printf("\nfirst pass..."); fflush(stdout);
+     for (int lvl = 0; lvl <= slm.getN(); ++lvl) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605091844.u49IimlN081360>