Modifying a MAIN-CLASS.java file to make an application run continuously

I have an executable .jar file that runs on Windows command line and does the following: the user types in "java -jar Uqailaut.jar" and then a word in the Inuit language Inuktitut, for example "java -jar Uqailaut.jar kiluutaq" and presses enter.  The program then outputs an analysis (i.e. parse) of that word in terms of its different morphological components; the resulting output for "kiluutaq" is:
{kilu:kiluaq/1v}{utaq:ut/1vn}
{kilu:kiluk/1v}{utaq:ut/1vn}
Where the two lines represent two possible decompositions of the word.  I would like to analyze all the words in an entire 50,000 word+ corpus using this program, but obviously I can't be doing it one word at a time!  So my question is, how can I get the program to run automatically over a large text file, and preferably output a text file.  I have attached the MAIN-CLASS.java file to this question.  Thanks for your help and suggestions!
Decompose.java
MarkMcAndrewsAsked:
Who is Participating?
 
CEHJCommented:
You shouldn't need to modify it. In a Unix OS, you could just do

java Decompose $(cat word-file)

Open in new window


You should be able to do the same thing at the Windows command line, but i'm not sure of the syntax. You could try

java Decompose (type word-file)

Open in new window


If that doesn't work, then add the DOS topic area to this question
0
 
MarkMcAndrewsAuthor Commented:
Dear CEHJ, thanks so much for your help.  In GIT BASH I entered

$ java -jar Uqailaut.jar $(cat file.txt)

And the program indeed read from the txt file!  It also worked for .csv files, but not .doc files (which is fine).  The problem is that it only analyzes/outputs the last word in the .txt or .csv file and ignores earlier words.  If I had to guess it would be that the program is only set up to output one word at a time (I'm not sure about that though - maybe there is something with the formatting of the input file where it can't read multiple words?).  Would it be possible to give every word in the corpus its own file then have the program open each file individually?  I'm not sure which direction to go at this point.  But I am further ahead than I was before!
0
 
CEHJCommented:
Might be to do with line feeds. Try

java -jar Uqailaut.jar $(tr '\r\n,' ' ' <file.txt)

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
MarkMcAndrewsAuthor Commented:
I ran that line of code and got the same result.
0
 
CEHJCommented:
Can you put the jar somewhere i can test it?
0
 
MarkMcAndrewsAuthor Commented:
Update: I wrote a script that looped through all the files in a directory.  Your expertise on how to get the program to read from a file was exactly what I needed.  Thank you!!
0
 
CEHJCommented:
Update: I wrote a script that looped through all the files in a directory.  
That of course wouldn't have changed the problem you referred to
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.