Closed anasrferreira closed 9 years ago
Number of instances of <string> and </string> in dictionary.imat (or file.xml.imat) is not always the same. Run:
<string>
</string>
/opt/BIDMach_1.0.0-full-linux-x86_64/bidmach utils.scala examples.scala newdict.count("<string>") res20: Double = 98953.0 newdict.count("</string>") res21: Double = 96029.0
To see when this occurs, search for tags <event> and </event>
<event>
</event>
Seems like in most cases it finds the pattern ;< instead.
;<
find(xmlFile(eventIdx(?,0))==newdict("<string>") .* (xmlFile(eventIdx(?,1)-1) != newdict("</string>"))) val n = newdict(xmlFile(eventIdx(2,0)->eventIdx(2,1))(find(xmlFile(eventIdx(2,0)->eventIdx(2,1))>0))) n(size(n,1)-1) res24: String = string n(size(n,1)-2) res28: String = ;<
An example where it is parsed correctly:
find(xmlFile(eventIdx(?,0))==newdict("<string>") .* (xmlFile(eventIdx(?,1)-1) == newdict("</string>"))) val nn = newdict(xmlFile(eventIdx(7,0)->eventIdx(7,1))(find(xmlFile(eventIdx(7,0)->eventIdx(7,1))>0))) nn(size(nn,1)-1) res31: String = </string> nn(size(nn,1)-2) res32: String = music
We can work around this, but @lambdaloop is looking into this. Might be of interest to @jcanny
Solved by @lambdaloop in 7b17ae500ca47faf1adb71fabc5fb44353b89e34
Number of instances of
<string>
and</string>
in dictionary.imat (or file.xml.imat) is not always the same. Run:To see when this occurs, search for tags
<event>
and</event>
Seems like in most cases it finds the pattern
;<
instead.An example where it is parsed correctly: