Invoking brill tagger through C#
Posted
by
Toshal Mokadam
on Stack Overflow
See other posts from Stack Overflow
or by Toshal Mokadam
Published on 2012-03-28T11:15:57Z
Indexed on
2012/03/28
11:29 UTC
Read the original article
Hit count: 607
We want to use brill tagger such that on a button click, it will tag the Input.txt into output.txt. So we have created a new visual studio project and put a button. On button click event we wrote the following code. There are no errors and we can see the command prompt getting invoked. But the output file is not getting created. The code is as follows. could you pls guide us??
private void button1_Click(object sender, EventArgs e)
{
ProcessStartInfo brillStartInfo = new ProcessStartInfo(@"C:\Users\toshal\Documents\Visual Studio 2008\Projects\brill tagger\bin\brill.exe");
brillStartInfo.Arguments = "/C brill.exe LEXICON.BROWN Input.txt BIGRAMS LEXICALRULEFILE.BROWN CONTEXTUALRULEFILE.BROWN > output.txt";
brillStartInfo.UseShellExecute = false;
brillStartInfo.RedirectStandardOutput = true;
brillStartInfo.RedirectStandardError = true;
brillStartInfo.CreateNoWindow = false;
Process brill = new Process();
brill.StartInfo = brillStartInfo;
brill.Start();
string output = brill.StandardOutput.ReadToEnd();
brill.WaitForExit();
}
© Stack Overflow or respective owner