gn model file and specify JSON mode alternatively, JSON decoders are initialized by default using the constructor call: JarafeTagger jdecoder = new JarafeTagger("my-model-file") // create decoder, assign model and specify JSON mode TEXT:
JarafeTagger jdecoder = new JarafeTagger(); jdecoder.initializeAsText("my-model-file"); // assign model file and specify Text mode
It is also possible to instantiate a JarafeTagger object with the full range of options available to jCarafe decoders as described in the jCarafe Users' Guide. This is done by passing in an array of strings that represents the command-line arguments to pass to the decoder. The example below instantiates a JarafeTagger, but indicates that it should not do its own pre-processing using the "--no-pre-proc" option.
JarafeTagger jdecoder = new JarafeTagger(); jdecoder.initialize("--model","my-model-file","--no-pre-proc"); // specifiy options as they would appear on the command-line