Closed Kaljurand closed 10 years ago
Could you please provide the (reduced) input file with steps to repro. Thanks.
$ echo '{"sentences":[{"text":"text"}]}' | python -mjson.tool | etana analyze -lex ../dct/ | python -mjson.tool
Expecting property name: line 2 column 2 (char 3)
The first call to Python succeeds, the 2nd does not...
The sample provided does not have a proper input file structure. It does not have paragraphs neither words. The cmdline version used does not threat mis-structured data correctly. New version is more reliable on that sense. Please retry and confirm success.
I'm getting compilation errors with the latest version (let me know if I should open a new issue and provide more details):
$ make -f Makefile.etana
g++ -O2 -DNDEBUG -Wall -std=gnu++0x -fdata-sections -ffunction-sections -Wl,--gc-sections -o etana ../../etana/*.cpp ../../../../lib/proof/*.cpp ../../../../lib/etana/*.cpp ../../../lib/*.cpp ../../../../lib/fsc/*.cpp -pthread
../../etana/etana.cpp: In member function ‘virtual void CMyJSONReader::OnValReadStart(const CFSAString&)’:
../../etana/etana.cpp:34:46: error: ‘KeyMatch’ was not declared in this scope
} else if (KeyMatch(szKey, "/paragraphs/%d")) {
^
../../etana/etana.cpp: In member function ‘virtual void CMyJSONReader::OnValReadEnd(const CFSAString&, CFSVar&)’:
../../etana/etana.cpp:63:46: error: ‘KeyMatch’ was not declared in this scope
} else if (KeyMatch(szKey, "/paragraphs/%d")) {
^
../../../../lib/proof/suggestor.cpp:9:44: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
static const CFSWString szInsertLettersBeg=L"KPSTVLMRAHNEJIO\x00dc"L"DFUB\x00d5"L"G";
^
../../../../lib/proof/suggestor.cpp:9:68: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
static const CFSWString szInsertLettersBeg=L"KPSTVLMRAHNEJIO\x00dc"L"DFUB\x00d5"L"G";
^
../../../../lib/proof/suggestor.cpp:10:41: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
static const CFSWString szInsertLetters=L"AEISTLUNKMODRVGHJP\x00c4\x00d5"L"B\x00dc\x00d6";
^
../../../../lib/etana/komp.cpp: In member function ‘int MORF0::leia_algvorm(KOMPONENT*)’:
../../../../lib/etana/komp.cpp:468:12: warning: unused variable ‘idx’ [-Wunused-variable]
AVTIDX idx;
^
../../../../lib/etana/mrf-gen.cpp: In member function ‘bool ETMRFAS::GeneSTV(MRFTULEMUSED*, const FSXSTRING*, const FSXSTRING*, const FSXSTRING*, const FSXSTRING*, int, int, const FSXSTRING*)’:
../../../../lib/etana/mrf-gen.cpp:800:12: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]
if ( sl->Find(sl1) == -1) // see sõnaliik pole siin lubatud
^
make: *** [all] Error 1
My apologies, push error. Please retry.
Seems to be fixed. Thanks!
A recommended way of pretty-printing JSON files is Python's
json.tool
(see e.g. http://stackoverflow.com/questions/352098/how-can-i-pretty-print-json). The Vabamorf commandline clients sometimes produce output that is not compatible withjson.tool
(possibly because it's incompatible with JSON).To demonstrate the issue:
The offending files start with: