Skip to content

Commit 8567c5e

Browse files
committed
new tessdata folder location
1 parent 368fab1 commit 8567c5e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Model/TesseractOcr.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace a9t9Ocr
1111
class TesseractOcr : ITesseractOrc
1212
{
1313
public string Language { get; set; }
14-
private readonly string _pathToTestData = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\(a9t9)FreeOcr\tessdata";
14+
private readonly string _pathToTestData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\(a9t9)OcrDesktop\tessdata";
1515

1616
public TesseractOcr(string lang)
1717
{

ViewModel/LeftSideViewModel.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public String RecognizedText
114114
public delegate void ExitEventChanged(object sender, EventArgs args);
115115

116116
private readonly ITesseractOrc _tesseractOrc;
117-
private readonly string _pathToTestData = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\(a9t9)FreeOcr\tessdata";
117+
private readonly string _pathToTestData = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\(a9t9)OcrDesktop\tessdata";
118118
readonly ImageConverter _converter = new ImageConverter();
119119
public LeftSideViewModel(ITesseractOrc orc)
120120
{
@@ -201,7 +201,7 @@ public void BeginOcr(object obj)
201201
{
202202
if (!Directory.Exists(_pathToTestData))
203203
{
204-
MessageBox.Show("I am speechless: No Tesseract language data found.");
204+
MessageBox.Show("Ooops. Test image not found (no big deal, everything else should still work fine).\nI looked in: "+ _pathToTestData);
205205
return;
206206
}
207207

@@ -340,10 +340,10 @@ private void OpenLanguageFolder(object obj)
340340
{
341341
try
342342
{
343-
var path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\(a9t9)FreeOcr\tessdata";
343+
var path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\(a9t9)OcrDesktop\tessdata";
344344
if (!Directory.Exists(path))
345345
{
346-
MessageBox.Show("Folder user documents >(a9t9)FreeOcr\tessdata for Tesseract language data not found.");
346+
MessageBox.Show("Folder for Tesseract language training data not found. I looked at "+path);
347347
return;
348348
}
349349
// Directory.CreateDirectory(path);
@@ -364,7 +364,7 @@ private void OpenWebSite(object obj)
364364
}
365365
private void About(object obj)
366366
{
367-
MessageBox.Show("(a9t9) Free OCR for Windows Desktop V1.08\n\n(c) 2015 http://a9t9.com - Full source code available (GPL)\n\nCredits:\n* PDF processing: Ghostscript (GPL)\n* Iconset Dortmund (Creative Commons 3.0)", "About (a9t9) Free OCR for Windows Desktop");
367+
MessageBox.Show("(a9t9) Free OCR for Windows Desktop V1.08\n\n(c) 2015 http://a9t9.com - Full source code available (GPL)\n\nCredits:\n* OCR: Tesseract OCR (Google)\n* PDF processing: Ghostscript (GPL)\n* Iconset Dortmund (Creative Commons 3.0)", "About (a9t9) Free OCR for Windows Desktop");
368368
}
369369
public event PropertyChangedEventHandler PropertyChanged;
370370

ViewModel/MainWindowViewModel.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public MainWindowViewModel(Window windowForLanguageSupport, LeftSideViewModel le
3434
//var culturesName = cultures.Select(cultureInfo => cultureInfo.ThreeLetterWindowsLanguageName).ToList();
3535
//var uniqueCultures = culturesName.Distinct().ToArray();
3636
var filesName = new List<string>();
37-
var path = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + @"\(a9t9)FreeOcr\tessdata";
37+
var path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @"\(a9t9)OcrDesktop\tessdata";
3838
if (Directory.Exists(path))
3939
{
4040
string[] filePaths = Directory.GetFiles(path, @"*.traineddata");

0 commit comments

Comments
 (0)