Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
f31910d
Fix orders being posted as hidden
dimon222 Jan 27, 2026
8471bd2
Merge branch 'master' of github.com:WFCD/WFinfo
dimon222 Jan 27, 2026
0bb4f5a
Merge branch 'master' of github.com:WFCD/WFinfo
dimon222 Feb 22, 2026
fba9a80
* Add support most languages except of Thai, Japanese and Turkish
dimon222 Feb 26, 2026
8e8a880
Merge branch 'master' of github.com:WFCD/WFinfo into feature/multilan…
dimon222 Feb 26, 2026
c7fc11c
Coderabbit suggestions
dimon222 Feb 26, 2026
9cc5145
Various corrections to accuracy and rabbit's review patches
dimon222 Feb 27, 2026
42db901
Sort the error zip parts to ensure part0 always the first one to get …
dimon222 Feb 27, 2026
2f54078
Resolve Chinese filtering bug, nitpick corrections for rabbit
dimon222 Feb 27, 2026
3d74a05
Fix sorting of parts for split zip
dimon222 Feb 27, 2026
0bd8ec5
Remove redundant test sections
dimon222 Feb 27, 2026
983504f
Rabbit nitpicks
dimon222 Feb 27, 2026
be71c1a
Rabbit fixes, cleanup korean from unnecessary manual filtering
dimon222 Feb 28, 2026
804402e
Fix rabbit suggestions
dimon222 Feb 28, 2026
ad42802
Rabbit review corrections
dimon222 Feb 28, 2026
6cb476c
Fix korean, improve chinese, refactor and clean future test bed
dimon222 Feb 28, 2026
63ceea0
Rabbit review patches
dimon222 Mar 1, 2026
2774b6a
Rabbit review patches
dimon222 Mar 1, 2026
8cb060d
Rabbit review patches
dimon222 Mar 1, 2026
69e8356
Rabbit review patches, better handling of glyph languages
dimon222 Mar 1, 2026
82ae52f
Add autogeneration of .zip and update.xml
dimon222 Mar 1, 2026
1b88ce1
Add workaround to avoid I/O blockign
dimon222 Mar 1, 2026
039bda4
Hopefully now fully fix the ranges
dimon222 Mar 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 1 addition & 59 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,4 @@
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
*.bat text eol=crlf
58 changes: 58 additions & 0 deletions TestCharacterRanges.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System;
using WFInfo.LanguageProcessing;
using WFInfo.Settings;

namespace WFInfo.Test
{
/// <summary>
/// Simple test to verify character range generation works correctly
/// </summary>
public class TestCharacterRanges
{
public static void TestCharacterRanges()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
python3 - <<'PY'
import pathlib, re
files = list(pathlib.Path('.').rglob('TestCharacterRanges.cs'))
if files:
    p = files[0]
    src = p.read_text(encoding='utf-8', errors='ignore')
    cls = re.search(r'\bclass\s+(\w+)\b', src)
    if cls:
        cls_name = cls.group(1)
        # Look for method with same name as class (non-constructor pattern)
        m = re.search(rf'\b(public|private|internal|protected)\s+static\s+\w+\s+{cls_name}\s*\(', src)
        print(f"file={p}")
        print(f"class={cls_name}")
        print(f"has_conflicting_member={bool(m)}")
        if m:
            line = src.count('\n', 0, m.start()) + 1
            print(f"conflict_line={line}")
            # Show context around the conflict
            lines = src.split('\n')
            start = max(0, line - 2)
            end = min(len(lines), line + 1)
            print(f"context:")
            for i in range(start, end):
                print(f"  {i+1}: {lines[i]}")
    else:
        print("No class found")
else:
    print("TestCharacterRanges.cs not found")
PY

Repository: WFCD/WFinfo

Length of output: 245


Rename TestCharacterRanges(); current signature is a compile error.

Line 12 declares a method with the same name as its enclosing class with a return type, which is invalid in C# (CS0542). In C#, only constructors may share the class name, and they cannot have explicit return types.

🛠️ Proposed fix
-        public static void TestCharacterRanges()
+        public static void RunCharacterRangeTests()
         {
             Console.WriteLine("Testing character range generation...");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static void TestCharacterRanges()
public static void RunCharacterRangeTests()
{
Console.WriteLine("Testing character range generation...");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@TestCharacterRanges.cs` at line 12, The method TestCharacterRanges()
conflicts with the enclosing class TestCharacterRanges because in C# a method
cannot have the same name as its class; rename the method (e.g., to
RunTestCharacterRanges or ExecuteTestCharacterRanges) and update any callers, or
if you intended a constructor remove the return type and make it parameterless
constructor; modify the method signature referenced as TestCharacterRanges()
accordingly and ensure references are updated to the new method name.

{
Console.WriteLine("Testing character range generation...");

// Create a mock settings object
var settings = new TestApplicationSettings();

try
{
// Test Japanese processor
var japaneseProcessor = new JapaneseLanguageProcessor(settings);
var japaneseWhitelist = japaneseProcessor.CharacterWhitelist;
Console.WriteLine($"Japanese whitelist length: {japaneseWhitelist.Length}");

// Test Korean processor
var koreanProcessor = new KoreanLanguageProcessor(settings);
var koreanWhitelist = koreanProcessor.CharacterWhitelist;
Console.WriteLine($"Korean whitelist length: {koreanWhitelist.Length}");

// Test Chinese processors
var simplifiedProcessor = new SimplifiedChineseLanguageProcessor(settings);
var simplifiedWhitelist = simplifiedProcessor.CharacterWhitelist;
Console.WriteLine($"Simplified Chinese whitelist length: {simplifiedWhitelist.Length}");

var traditionalProcessor = new TraditionalChineseLanguageProcessor(settings);
var traditionalWhitelist = traditionalProcessor.CharacterWhitelist;
Console.WriteLine($"Traditional Chinese whitelist length: {traditionalWhitelist.Length}");

Console.WriteLine("All character range tests passed!");
}
catch (Exception ex)
{
Console.WriteLine($"Error testing character ranges: {ex.Message}");
throw;
}
}
}

/// <summary>
/// Mock application settings for testing
/// </summary>
public class TestApplicationSettings : IReadOnlyApplicationSettings
{
public string Locale => "en";
// Add other required properties as needed
}
Comment on lines +53 to +57
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
python - <<'PY'
import pathlib, re

iface_file = None
iface_src = None
for p in pathlib.Path('.').rglob('*.cs'):
    s = p.read_text(encoding='utf-8', errors='ignore')
    if 'interface IReadOnlyApplicationSettings' in s:
        iface_file, iface_src = p, s
        break

test_file = next(pathlib.Path('.').rglob('TestCharacterRanges.cs'))
test_src = test_file.read_text(encoding='utf-8', errors='ignore')

print(f"interface_file={iface_file}")
print(f"test_file={test_file}")

iface_members = set(re.findall(r'\b(?:string|int|bool|double|float|decimal|long|short|byte|object|[A-Za-z_][A-Za-z0-9_<>,\[\]\?]*)\s+([A-Za-z_][A-Za-z0-9_]*)\s*\{\s*get;\s*\}', iface_src))
impl_match = re.search(r'class\s+TestApplicationSettings\s*:\s*IReadOnlyApplicationSettings\s*\{([\s\S]*?)\n\s*\}', test_src)
impl_body = impl_match.group(1) if impl_match else ''
impl_members = set(re.findall(r'\b([A-Za-z_][A-Za-z0-9_]*)\s*=>', impl_body))
impl_members |= set(re.findall(r'\b([A-Za-z_][A-Za-z0-9_]*)\s*\{\s*get;', impl_body))

missing = sorted(iface_members - impl_members)
print(f"interface_member_count={len(iface_members)}")
print(f"implemented_member_count={len(impl_members)}")
print(f"missing_sample={missing[:20]}")
PY

Repository: WFCD/WFinfo

Length of output: 500


TestApplicationSettings does not fully implement IReadOnlyApplicationSettings.

The interface defines 76 members, but only Locale is implemented. Missing 75 members including: ActivationKey, ActivationKeyKey, ActivationMouseButton, Auto, AutoCSV, AutoCount, AutoDelay, AutoList, CF_pBMax, CF_pBMin, and others. This is a compile-blocking error—all interface members must be implemented.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@TestCharacterRanges.cs` around lines 53 - 57, The TestApplicationSettings
class currently only implements Locale but must implement all members of
IReadOnlyApplicationSettings; either implement every required property/method on
TestApplicationSettings (matching the interface signatures) by adding the
missing properties like ActivationKey, ActivationKeyKey, ActivationMouseButton,
Auto, AutoCSV, AutoCount, AutoDelay, AutoList, CF_pBMax, CF_pBMin, etc.,
providing appropriate test-friendly default values or auto-properties, or change
TestApplicationSettings to be abstract so it does not need to supply
implementations; ensure each member name and type exactly matches the interface
contracts and that any methods/properties required by
IReadOnlyApplicationSettings are present (you can use simple defaults or throw
NotImplementedException for members not used in tests).

}
36 changes: 36 additions & 0 deletions WFInfo/CustomEntrypoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using System.Linq;
using System.CodeDom;
using Tesseract;
using WFInfo.Tests;

namespace WFInfo
{
Expand Down Expand Up @@ -83,6 +84,41 @@ public static void Main()

Directory.CreateDirectory(appPath);

// Check for test execution arguments
// Usage: WFInfo.exe [--test] map.json [output.json]
string[] args = Environment.GetCommandLineArgs().Skip(1).ToArray();
bool isTestMode = false;

if (args.Length >= 1 && (args[0].Equals("--test", StringComparison.OrdinalIgnoreCase) ||
args[0].Equals("-test", StringComparison.OrdinalIgnoreCase) ||
args[0].Equals("--map", StringComparison.OrdinalIgnoreCase)))
{
isTestMode = true;
args = args.Skip(1).ToArray(); // strip flag
}
else if (args.Length >= 1 && args[0].EndsWith(".json", StringComparison.OrdinalIgnoreCase))
{
isTestMode = true;
}

if (isTestMode)
{
try
{
Console.WriteLine("WFInfo OCR Test Runner");
Console.WriteLine("=======================");
TestProgram.RunTests(args).GetAwaiter().GetResult();
return;
}
catch (Exception ex)
{
Console.WriteLine($"Test execution failed: {ex.Message}");
Console.WriteLine(ex.StackTrace);
Environment.Exit(1);
return;
}
}

string thisprocessname = Process.GetCurrentProcess().ProcessName;
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
if (Process.GetProcesses().Count(p => p.ProcessName == thisprocessname) > 1)
Expand Down
Loading