Reputation: 63
I have EnglishSD.nbin file in Resources sub Models_folder I am accessing the path like this in my xamarin.android project but I am getting file not found Please help me with your suggestions thanks
var modelPath = AppDomain.CurrentDomain.BaseDirectory + "D:\\Foldername\\Project Name
\\Resources\\Models\\EnglishSD.nbin";
var sentenceDetector = new EnglishMaximumEntropySentenceDetector(modelPath);
var sentences = sentenceDetector.SentenceDetect(paragraph);
return sentences;
Error
Error: File not found Error
Upvotes: 0
Views: 691
Reputation: 36
I'm not familiar with a ".nbin" file, but I would recommend putting it in the Android Assets
folder instead.
You can read files from Assets
like this:
public async Task<byte[]> ReadPdfFileAsync()
{
using (var fileStream = Assets.Open("pdf-file.pdf")
using (var memoryStream = new MemoryStream())
{
await fileStream.CopyToAsync(memoryStream);
return memoryStream.ToArray();
}
}
Upvotes: 1