Open sdg002 opened 5 years ago
Ok. I figured this out myself. I should be calling the GetTokenizer
method of the factory and then invoke the method Tokenize
.
var options = new CH.TokenizationOptions
{
};
var factory = new CH.TokenizerFactory(
options,
global::CherubNLP.SupportedLanguage.English);
var tokenizer = factory.GetTokenizer<CH.TreebankTokenizer>();
var tokens = tokenizer.Tokenize(sentence,options);
string[] results = tokens.
Where(tk=>tk.IsAlpha==true).
Select(tk => tk.Text).ToArray();
return results;
Hi All, I am trying to get some very basic tokenization to work. I think I am not using the API properly because the method
Tokenize
is throwing System.NullReferenceException. Any suggestions?My code
Thank you, Sau