-
Notifications
You must be signed in to change notification settings - Fork 50
Add multi-language support #413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
f31910d
8471bd2
0bb4f5a
fba9a80
8e8a880
c7fc11c
9cc5145
42db901
2f54078
3d74a05
0bd8ec5
983504f
be71c1a
804402e
ad42802
6cb476c
63ceea0
2774b6a
8cb060d
69e8356
82ae52f
1b88ce1
039bda4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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() | ||
| { | ||
| 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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]}")
PYRepository: WFCD/WFinfo Length of output: 500
The interface defines 76 members, but only 🤖 Prompt for AI Agents |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
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
📝 Committable suggestion
🤖 Prompt for AI Agents