<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">The attached patch should fix it. Note
this still doesn't support vocabularies larger than 2^32, but the
number of higher-order ngrams can now be 2^64. <br>
<br>
Thanks for reporting this problem!<br>
<br>
Andreas<br>
<br>
<br>
On 9/19/2013 4:13 AM, Juan Pino wrote:<br>
</div>
<blockquote
cite="mid:CAF1NyNP7dr0H2SnHhEjj6-5d93gth4xBq0qSLdqjJszg6peg-w@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I am running this command with version 1.7.0 (the purpose
is to fix the format of my input lm):</div>
<div><br>
</div>
<div>srilm1.7.0/bin/i686-m64/ngram -debug 1 -order 4 -lm
MY_LM_IN_ARPA_FORMAT -write-lm MY_OUTPUT_LM</div>
<div><br>
</div>
<div>I get this error:</div>
<div><br>
</div>
<div>line 6: ngram number -1840328771 out of range<br>
</div>
<div><br>
</div>
<div>This is because I have this header in my input lm:</div>
<div>ngram 4=2454638525<br>
</div>
<div><br>
</div>
<div>So the number of 4grams is bigger than the maximum 32-bit
int.</div>
<div><br>
</div>
<div>I've fixed it by replacing</div>
<div>int nNgrams;</div>
<div>by</div>
<div>long nNgrams;</div>
<div>at line 497 in lm/src/NgramLM.cc and by replacing</div>
<div>} else if (sscanf(line, "ngram %d=%d", &thisOrder,
&nNgrams) == 2) {</div>
<div>by</div>
<div>} else if (sscanf(line, "ngram %d=%ld", &thisOrder,
&nNgrams) == 2) {<br>
</div>
<div>at line 515 in lm/src/NgramLM.cc</div>
<div><br>
</div>
<div>Are there other places in the code that I should change ?
Is there a better solution for my problem ?</div>
<div><br>
</div>
<div>Thanks very much,</div>
<div><br>
</div>
<div>Juan</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SRILM-User site list
<a class="moz-txt-link-abbreviated" href="mailto:SRILM-User@speech.sri.com">SRILM-User@speech.sri.com</a>
<a class="moz-txt-link-freetext" href="http://www.speech.sri.com/mailman/listinfo/srilm-user">http://www.speech.sri.com/mailman/listinfo/srilm-user</a></pre>
</blockquote>
<br>
</body>
</html>