Hi
I am trying to write a perl script that can send input from KEYBOARD
and get the output back to the program which should have the
translation stored in a variable.
So far, i have this:
print TERMINAL "Enter some text: ";
while (<KEYBOARD>) {
last if /quit/; # stop when 'quit' is entered
print; # send keyboard input to the program
while($reply = <STDIN>) { # get (first line of) reply from program
chop $reply; # remove trailing "\n" character
open FILE, ">file.txt" or die $!;
print FILE $reply;
close FILE;
print TERMINAL "Response: \"$reply\"\n\n";
}
}
print TERMINAL "\nDone.\n";
kill $pid;
exit;
This is just part of the program. All this does is starts Moses as
a child process using the exec command with arguments.
gets input from the KEYBOARD but the problem is the output it prints
everything that moses prints out; so i tried using a FILE but that gets
only the last thing which is "Finished translating"
Is there a way to get the translation and store it in a variable ?
Thanks,
Vineet
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support