Open cerisara opened 9 years ago
The problem may come from the transcription, which contains '_' tokens (because it works on another jtr file). It looks like these tokens are not supported by jtrans. I'll check that... ... no it's not the case. So may be it's because it's a TrackProject and not a TurnProject...
This bug is related to the GSon parser that has problems deserializing the inner "Phrase" objects. I wrote a test for this, which for now succeeds because of some debug code that I've written and that returns fake/dummy Phrase objects, instead of the real ones, when deserializing. But the the only way I can imagine for now is to rewrite this deserialization, field by field, boring, but what else...
I've also noted that several other unit tests fail. These should be checked, and maybe I should install some kind of continuous integration to prevent such "re-discovery" of packed failings in the future...
This bug might cause other problems: for instance, I just noted that deserializing a TurnProject from a JTR file creates null pointers to TurnProject from the inner class Turn objects; so this creates a NullPointerException when calling inferAnchors() for instance.
From Oracle javadoc: "Serialization of inner classes, including local and anonymous classes, is strongly discouraged." So this issue should be solved by extracting the inner class... (?)
I've tried to extract the class without too much thinking, but then, alignment fails. Don't have time to dig in that, so I just wrote a small hack to fix the inner class just Turn after deserialization. This is in the private branch mcmc for now.
when parsing a .jtr file that has just been generated by jtrans, I got:
java.lang.ClassCastException: java.util.ArrayList cannot be cast to fr.loria.synalp.jtrans.project.Phrase at fr.loria.synalp.jtrans.gui.table.TrackModel$LinearBridge.(TrackModel.java:140)
at fr.loria.synalp.jtrans.gui.table.TrackModel.populateRows(TrackModel.java:93)
at fr.loria.synalp.jtrans.gui.table.TrackModel.(TrackModel.java:86)
at fr.loria.synalp.jtrans.gui.table.ProjectTable.refreshModel(ProjectTable.java:171)
at fr.loria.synalp.jtrans.gui.table.ProjectTable.(ProjectTable.java:50)
at fr.loria.synalp.jtrans.gui.JTransGUI.initPanel(JTransGUI.java:251)
at fr.loria.synalp.jtrans.gui.JTransGUI.setProject(JTransGUI.java:495)
at fr.loria.synalp.jtrans.gui.JTransGUI.friendlyLoadMarkup(JTransGUI.java:358)
at fr.loria.synalp.jtrans.gui.JTransGUI.(JTransGUI.java:223)
at fr.loria.synalp.jtrans.JTrans.main(JTrans.java:412)