Closed Jorgen-P closed 6 years ago
What command line options did you use to run the script? Are you redirecting with something like < infile.txt
?
Command line:
./run @mode=simple -Grammar.inPaths data/tutorial.grammar < data/simple_text.txt
Where simple_text.txt contains a single line with "3 plus 4". When running interactive with the same options (except the redirect) it works. With redirect it gives the message: main()Invalid command: '3 plus 4'
Found it. The text file is read before the interactive prompt is started.
During the batch mode (before the interactive prompt starts; could last a long time if training and test data are supplied), stdin is used to debug the run using the commands in fig/src/main/java/fig/exec/MonitorThread.java
One possible way to supply input from a file is to create an example file.
hello.examples
(example (utterance "3 plus 4"))
. You can also add expected result: (example (utterance "3 plus 4") (targetValue (number 7)))
-Dataset.inPaths anyname:hello.examples
to the run arguments (anyname
can be any string except train
)Thank you, that works.
I can only get the parser to take interactive input. When I point stdin to a file the run script takes it as options. Output redirects ok. How can I get it to read from a file in the same way as it reads in the interactive prompt?