Skip to content
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

Bug Report #42

Closed
claycat opened this issue Nov 12, 2021 · 6 comments
Closed

Bug Report #42

claycat opened this issue Nov 12, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@claycat
Copy link
Collaborator

claycat commented Nov 12, 2021

I found some bugs while working around with the current version of libhanjp

1. Letters containing the jamo PHIEUPH are unable to be converted into Japanese.

I wrote a simple test code with reference to test_input_context_convert.cpp

    const char *strGivenKeyInput = "qkqlqnqh.";
    const char *strExpectJapanese = "ばびぶぼ.";

which gave me the following failure

Expected equality of these values:
strActualJapanese
Which is: "\xE3\x81\x89."
As Text: "ぉ."
strExpectJapanese
Which is: "\xE3\x81\xB0\xE3\x81\xB3\xE3\x81\xB6\xE3\x81\xBC."
As Text: "ばびぶぼ."
[ FAILED ] InputContextTest.IC_PIEUP (0 ms)

Initially, I thought this problem was due to a mistake in declaration since other jamos are working fine.
I checked the basic declaration files such as hanjpunicode.h and keyboard.xml but there didn't seem to be any errors there.

2. The conversion from 'wa' (와) to ’わ’ fails to convert under some cases

    const char *strGivenKeyInput = "zydndhkzhzn.";
    const char *strExpectJapanese = "きょうわこく.";

with the following failure

Expected equality of these values:
strActualJapanese
Which is: "\xE3\x81\x8D\xE3\x82\x88\xE3\x81\x86\xE3\x81\x8B\xE3\x81\x93\xE3\x81\x85.\xE3\x85\x97"
As Text: "きようかこぅ.ㅗ"
strExpectJapanese
Which is: "\xE3\x81\x8D\xE3\x82\x87\xE3\x81\x86\xE3\x82\x8F\xE3\x81\x93\xE3\x81\x8F."
As Text: "きょうわこく."
[ FAILED ] InputContextTest.IC_KYOUWAKOKU (0 ms)

3. Pressing shift

Pressing shift to insert double consonants, such as ㅃ

Expected behavior

no input on screen

Current behavior

shows £ sign (for left shift) or ¬ (for right shift)

4. Newline

Pressing enter to insert newline

Expected behavior

no input on screen. go to next line

Current behavior

shows only '-' sign.

Pressing shift+enter works, but always with an unnecessary £(from #3)


I read the new issue onting/ibus-hanjp/#52 regarding the engine bug, but am still unsure how this bug is related to the bugs mentioned above.

@claycat claycat added the bug Something isn't working label Nov 12, 2021
@onting
Copy link
Collaborator

onting commented Nov 13, 2021

Good, I'll check it out.

@onting
Copy link
Collaborator

onting commented Nov 23, 2021

Ah, you meant PIEUP in trouble '1'.
Your report is understandable enough, though it's better to check our character representation with Hangul Unicode Table.
Anyway, '1' should be fixed with my upcoming patch.

onting added a commit that referenced this issue Nov 23, 2021
It changes automata comment to more readable.
It fixes am_push by fixng row index selecting code.
@onting
Copy link
Collaborator

onting commented Nov 23, 2021

Can you push your test cases into 'test' branch in this repo? @catensia
It would boost my work.

@onting
Copy link
Collaborator

onting commented Nov 23, 2021

If you are using VS Code, setting .vscode/launch.json as below would help libhanjp debug.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++ - Build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${cwd}/build/test/test_input_context_convert",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}

onting added a commit that referenced this issue Nov 23, 2021
It fixes am_push by adding missing conditions into Choseong/Jungseong eatting step.
@onting
Copy link
Collaborator

onting commented Nov 24, 2021

Closing with above

@onting onting closed this as completed Nov 24, 2021
@claycat
Copy link
Collaborator Author

claycat commented Nov 29, 2021

Sorry for the late response. I went through the fixes, and it seems to be working well.
I'll try to write some more test suites regarding other potential problems mentioned in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants