Today I want to call CRFs in C #, but the old problem. There are several reasons. First, I do not understand the CRF, although I ran with a cmd, but do not understand why, and just a cursory look at the next parameter to enter what, just understand the form, no understanding of the substance. So at the time of the call, I don't know how to transfer the input and output parameters. In addition, Crf_learn in the CMD run time, the use of a self-brought DLL file I do not know how to deal with. And I can't find an example of a similar call on the Internet. Second, not familiar with the instance code found, do not understand the meaning and function of each line of code. Third, do not know how to output the result, will not be the appropriate breakpoint.
After a classmate's help, he helped me to solve the problem. The final run was successful.
Console.WriteLine ("AAAAA"); For test output
System.Diagnostics.Process p = new System.Diagnostics.Process (); Start System process
P.startinfo = new System.Diagnostics.ProcessStartInfo (@ "C:\Users\AMY\Desktop\test\crf_learn.exe"); Application path
P.startinfo.arguments = @ "C:\Users\AMY\Desktop\test\template C:\Users\AMY\Desktop\test\train.data C:\Users\AMY\ Desktop\test\model "; Parameter input
P.startinfo.redirectstandardoutput = true; Result output
P.startinfo.useshellexecute = false; Whether to display in the shell
P.start ();
p.WaitForExit ();
Console.WriteLine ("nnnn");
Console.readkey ();
C # calls the CRFs application