Skip to content

cause exception when analyze character string that ends with numeral and dot. #157

@hts-ozeki

Description

@hts-ozeki

When we analyze character string that ends with numeral and dot, jumanpp_v2 causes exception.

Tested version: juman++ 2.0.0-rc4
Build environment: VisualStudio 2022 on Windows

Reproduction method: type in command prompt

chcp 65001
echo 10.| jumanpp_v2.exe --model=jumandic-rnn.model

Workaround: add a boundary check.

--- jumanpp-2.0.0-rc4\src\core\analysis\numeric_creator.cc
+++ jumanpp_lib-2.0.0-rc4\src\core\analysis\numeric_creator.cc
@@ -246,6 +246,7 @@
if (!codepoints[posPeriod].hasClass(PeriodClass)) return 0;
if (!codepoints[posPeriod - 1].hasClass(charClass_)) return 0;
if (pos + 1 < codepoints.size() &&

  •  posPeriod + 1 < codepoints.size() &&
     codepoints[posPeriod + 1].hasClass(charClass_))
    
    return 1;
    return 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions