perezale / jahmm

Automatically exported from code.google.com/p/jahmm
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Reading HMM error "Line 6: Syntax error: unexpected token ',' (A' expected)" #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. write hmm to textual file
2. read hmm from textual file

What is the expected output? What do you see instead?
It is expected that reading the hmm from a file works but it doesn't
because of the error "Line 6: Syntax error: unexpected token ',' (A' expected)"
"," is used as decimal seperator when exporting an hmm to a file. But when
reading back in this exports, jahmm doesn't understand "," as a decimal
seperator and throws an error.

Please provide any additional information below.
You can fix the reading function OR the writing function to avoid this problem

I changed the writing functions this way:

Add this code:
        DecimalFormatSymbols dfs = formatter.getDecimalFormatSymbols();
        dfs.setDecimalSeparator('.');
        formatter.setDecimalFormatSymbols(dfs);

in OpdfWriter.java:60 AND HmmWriter:63

Now it uses "." instead of "," as decimal seperator when writing an export
to a file.

(I did only test it with my application (ObservationVector and
MultiGaussianDistribution...)

kind regards,
Ben

Original issue reported on code.google.com by vamos.be...@gmail.com on 3 Jun 2010 at 4:25