GithubHelp home page GithubHelp logo

libhangul / libhangul Goto Github PK

View Code? Open in Web Editor NEW
189.0 189.0 87.0 6.11 MB

A library to support hangul input method logic

License: GNU Lesser General Public License v2.1

Shell 0.06% Makefile 1.27% C 92.08% Python 1.58% Ruby 0.19% M4 0.57% SWIG 0.37% CMake 3.89%

libhangul's Introduction

libhangul's People

Contributors

byvoid avatar changwoo avatar choehwanjin avatar imfine98 avatar jooncheol avatar studioego avatar wkpark avatar youknowone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libhangul's Issues

Cannot build with CMake

It seems libhangul is adopting CMake for build configuration in recent commits. (7b2c154 in this repo, b6f9837 in choehwanjin/libhangul cmake branch)

But I cannot configure the build environment using CMake. (It seems hangul-config.cmake.in is missing in recent commits)

I tried configuring with CMake with the following CLI commands:

# pwd: libhangul cloned repo dir
$ mkdir build && cd build
$ cmake ..

It shows the following error message:

CMake Error: File /home/jsyoo5b/Workspace/libhangul/hangul-config.cmake.in does not exist.
CMake Error at /usr/share/cmake-3.16/Modules/CMakePackageConfigHelpers.cmake:330 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:49 (configure_package_config_file)

As the CMake documentation says, configure_package_config_file need input file hangul-config.cmake.in, which has been described in error log.

Could someone please check whether the hangul-config.cmake.in were missed on recent commits?

Build failure on 10.6.8: sed: -e: No such file or directory

I am trying to build libhangul from the latest commit. The build fails on:

[ 72%] Generating hangul-keyboard-2.xml
cd /opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build/data/keyboards && sed -i -e '1 D' -e '/^<hangul-keyboard/D' -e '/^<\/hangul-keyboard/D' -e 's/^ *<name/ <name/' hangul-keyboard-2.name.xml
sed: -e: No such file or directory
make[2]: *** [data/keyboards/hangul-keyboard-2.xml] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 75%] Generating hangul-keyboard-2y.xml
cd /opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build/data/keyboards && sed -i -e '1 D' -e '/^<hangul-keyboard/D' -e '/^<\/hangul-keyboard/D' -e 's/^ *<name/ <name/' hangul-keyboard-2y.name.xml
sed: -e: No such file or directory
make[2]: *** [data/keyboards/hangul-keyboard-2y.xml] Error 1
[ 78%] Generating hangul-keyboard-39.xml
cd /opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build/data/keyboards && sed -i -e '1 D' -e '/^<hangul-keyboard/D' -e '/^<\/hangul-keyboard/D' -e 's/^ *<name/ <name/' hangul-keyboard-39.name.xml
sed: -e: No such file or directory
make[2]: *** [data/keyboards/hangul-keyboard-39.xml] Error 1
[ 81%] Generating hangul-keyboard-3f.xml
cd /opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build/data/keyboards && sed -i -e '1 D' -e '/^<hangul-keyboard/D' -e '/^<\/hangul-keyboard/D' -e 's/^ *<name/ <name/' hangul-keyboard-3f.name.xml
sed: -e: No such file or directory
make[2]: *** [data/keyboards/hangul-keyboard-3f.xml] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build'
make[1]: *** [data/keyboards/CMakeFiles/keyboard.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build'
[ 81%] Built target hangul
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCRosettaPorts_x11_libhangul/libhangul/work/build'
make: *** [all] Error 2

Same error with gcc-4.2 and gcc12, latest cmake.

potential buffer overrun issue in jamo_ext_B_table[] access

The following code could bring buffer overrun since jamo_ext_B_table[] definition does not
have characters between 0xd7c6 and 0xd7cb. Access between these positions should be excluded.

File hangul/hangulctype.c: line 578

} else if (c >= 0xd7b0 && c <= 0xd7fb) {
ret = jamo_ext_B_table[c - 0xd7b0];

한글 조합과 관련 없는 키 모두에 대해 사용하지 않도록 처리

현재 hangul_ic_process()에서 한글 조합과 관련없는 키 중에서 스페이스나 탭은 false를 리턴하고 숫자나 기호는 true를 리턴하면서 hangul_ic_get_commit_string() 결과에 그 숫자나 기호가 포함되어 버리는데요.

처음에 저는 어떻게 되든 상관있나 생각했는데, libhangul/ibus-hangul#15 ibus-hangul 이슈를 보니 다른 숫자나 기호의 경우에도 false를 리턴하게 하는 게 맞는 것 같습니다. 그러면 숫자나 기호 키는 설정된 XKB 키맵에 따라 클라이언트에서 처리할 수 있을 겁니다.

potential interger overflow - hangul_combination_set_data() in hangulkeyboard.c line 280

The following code for malloc() could make integer overflow.
Function malloc takes size_t type and this sometimes does not matched to ULONG_MAX.
I think SIZE_MAX is proper here.

hangulkeyboard.c line 280 - in hangul_combination_set_data():

if (n == 0 || n > ULONG_MAX / sizeof(HangulCombinationItem))
return false;

combination->table = malloc(sizeof(HangulCombinationItem) * n);

한자(漢字) 목록의 오류 부분 수정

libhangul의 한자(漢字) 목록에서 오류가 몇가지 보이고 있습니다.

https://github.com/libhangul/libhangul/blob/master/data/hanja/hanja.txt

  1. 나우:老撾:라오스

老撾의 음은 노과이며, 나우가 아닙니다.
이 문제는 MS사 윈도우에서 실수로 들어간 오타로 보이며, 노과로 수정해야합니다

출처1: https://twitter.com/sai_Eoneo/status/1154661300565209088
출처2: https://twitter.com/studioego/status/1154680124534448133
출처3: https://twitter.com/sai_Eoneo/status/1154682367119785984

네이버 한자사전의 老撾링크: https://hanja.dict.naver.com/search?query=%E8%80%81%E6%92%BE

  1. 퐁:乓:

의 음은 입니다

물건을 부딪치는 소리 병, 물건을 부딪치는 소리 팡

출처: https://hanja.dict.naver.com/hanja?q=%E4%B9%93

이외에도 한자(漢字) 목록에 오류가 보이고 있습니다.

수정사항에 대하여 수정 정리 및 커밋하면 이슈 닫겠습니다.
커밋완료되면 리뷰 부탁드립니다.

No realtime translation of korean characters

Hi, I installed ibus, ibus-hangul and libhangul (using autotools).
The setup seems right, ibus works with the other languages. I am also able to open the setup of hangul ibus, select the options, enable hangul mode and so on. The only problem is that when i type on the keyboard, the characters do not change in korean symbols.

I noticed also that there is a command 'hangul' that is able to translate the word in korean, but the realtime translation do not work.

Do you have any tips in how to resolve?
(I'm using XFCE with X11.)

Thank you.

우분투 설치만 했고. 개발은 해본 적도 없지만

우선 윈도우에서 쓰는 대로 xml이라도 만들어 봤습니다.
그 다음부터 하나도 모르겠어요.

립한글을 아이버스 같은 입력기에 인식시키고 나서. 그걸 프로그램으로 만들라는 말 같기는 한데.
...

우분투에서 터미널 띄워놓고 리드미에 있는 문구 그대로 계속 쓰고 있었네요.
너무 초보적인 질문이라 미안합니다.

Header causes build errors when compiled with -Wpedantic

In file included from ../include/wlhangul.h:4,
                 from ../main.c:5:
/usr/include/hangul-1.0/hangul.h:176:46: error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
  176 |  int key, ucschar value) LIBHANGUL_DEPRECATED;
      |                                              ^
/usr/include/hangul-1.0/hangul.h:178:60: error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
  178 |  const HangulCombination *combination) LIBHANGUL_DEPRECATED;
      |                                                            ^
/usr/include/hangul-1.0/hangul.h:180:61: error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
  180 | unsigned    hangul_ic_get_n_keyboards() LIBHANGUL_DEPRECATED;
      |                                                             ^
/usr/include/hangul-1.0/hangul.h:181:76: error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
  181 | const char* hangul_ic_get_keyboard_id(unsigned index_) LIBHANGUL_DEPRECATED;
      |                                                                            ^
/usr/include/hangul-1.0/hangul.h:182:78: error: ISO C does not allow extra ‘;’ outside of a function [-Werror=pedantic]
  182 | const char* hangul_ic_get_keyboard_name(unsigned index_) LIBHANGUL_DEPRECATED;
      |                                                                              ^

ubuntu 17.10에서 세벌식 자판 설정 후 한글로 바꿀때 segfault 발생

먼저 이 훌륭한 라이브러리 개발에 정말 감사드립니다.

우분투 16.04에서는 문제가 없었는데, 17.10에서 문제가 발생하네요.
한글 자판을 세벌식 390 으로 설정하고 로그인 후 자판을 한글로 바꾸면 segfault가 발생합니다.
/dev/kmsg의 에러 메세지는 아래와 같습니다.

6,851,5404316732,-;ibus-engine-han[21793]: segfault at 1 ip 00007f357b9c2d7f sp 00007ffeb5267100 error 4 in libhangul.so.1.0.0[7f357b9b9000+1f000]

자판이 두벌식표준으로 설정된 상태에서 로그인 후 한글 설정은 세벌식으로 바꾸면 동작은 하는 상황입니다.

ubuntu 17.10, ibus-hangul 1.5.0 버전에서 위 에러 발생했습니다.

감사합니다.

두벌식 순아래 자판 추가

저는 createsc/3beol PPA에 존재하는 두벌식 순아래 자판을 사용하고 있습니다.
윈도우즈에서도 날개셋을 이용해 해당 자판을 사용하고 있는데 장점은 다음과 같습니다.

  • 모음을 두 번 눌러 쌍자음 입력
    • 왼손을 힘들게 하는 기존 두벌식과 다르게 놀고 있는 오른손이 같이 움직입니다
    • 자음을 두 번 누르는 방식의 쌍자음 입력과 다르게 모호함이 사라집니다. (학교/하꾜)
  • ㅒ/ㅖ 이중모음도 ㅑㅣ/ㅕㅣ로 입력 가능 (ㅟ, ㅙ 등과 일관성 유지)
  • 기존 두벌식과 완전 호환 (쉬프트를 이용한 쌍자음 입력 역시 지원 합니다)

(추가 정보: https://sites.google.com/site/tinyduckn/dubeolsig-sun-alae)
여러 장점이 있기 때문에 두벌식 순아래 자판을 추가해 주시면 좋을 것 같습니다.

"error: 'PATH_MAX' undeclared" in GNU Hurd

최근 Debian build 실패입니다.

https://buildd.debian.org/status/fetch.php?pkg=libhangul&arch=hurd-i386&ver=0.1.0%2Bgit20170815-1&stamp=1511811053&raw=0

https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html

위에 링크는 실제 사이즈에 맞춰서 동적 할당하는 좀 이상적인 방법을 얘기했는데 어렵고 실수하기도 쉬워서.. 간단한 해결책은 정의되어 있지 않으면 이런 식으로 하나 고정값으로 정의하는 겁니다.

#ifndef PATH_MAX
#define PATH_MAX 4096
#endif

hangul_init()과 hangul_fini()를 사용할 수 없어 보입니다.

제 코드에 hangul_init()과 hangul_fini()를 포함한 코드를 작성했는데 컴파일을 하는데 이 두 함수가 implicit declartion이라는 warning이 뜨네요.
libhangul-dev를 설치해 ubuntu에서 개발중입니다.
정상적으로 이 함수들을 사용할 수 있는게 맞나요?

User custom 자판을 등록할 수 있는 기능 제공

libhangul을 사용하는 개발자가 libhangul의 기본 자판 디렉토리 이외의 곳에서 파일을 등록하여 사용할 수 있게 하는 기능을 제공한다.
이렇게 하면 libhangul을 사용하는 app이 자신의 개별 자판 디렉토리를 사용할 수 있게 된다.
참고: #21

[SOLVED] No hangul input possible on KDE 5 / Plasma (Opensuse Leap 42.1)

Hi,

installed ibus on my Opensuse Leap 42.1 box, ibus_hangul pkg is version 1.5.0.2.2. I can select "Korean (hangul)", but I only can enter latin keys, no hangul. relase notes are saying that with this version a possibility to "toggle" between hangul and latin was added, but I have no idea how to "toggle". any advice would be great

hangul_cjamo_to_jamo 같은 함수는 없는지 궁금합니다

ibus기준 scanf로 'ㄱ'을 입력 받게 된후 ucs4로 변환하여 hangul_is_cjamo로 검사해보면 true로 나옵니다. 하지만 이 'ㄱ'을 대상으로 hangul_is_chosung을 호출할 경우 false를 리턴합니다. 'ㅏ'도 hangul_is_jungsung은 false를 리턴합니다. 먼저 jamo로 변환한 후 사용하여야 할 것 같은데 방법이 있는지 궁금합니다

Build fail

ubuntu 18.04에서 빌드시 다음과 같은 이슈가 있었습니다.

'%'-style pattern rules are a GNU make extension 이라는 오류 메시지가 출력됩니다.
이를 해결하기 위해서는 제공된 파일 내의 configure.ac 파일 안에 AM_INIT_AUTOMAKE([-Wno-portability])를 추가해줘야 빌드가 됩니다.

Some issues reported by Coverity Scan

Here are some reports from Coverity Scan for libhangul-0.1.0.

1. Defect type: GCC_ANALYZER_WARNING
1. libhangul-0.1.0/hangul/hanja.c:0: scope_hint: In function 'hanja_table_match'
2. libhangul-0.1.0/hangul/hanja.c:435:32: warning[-Wanalyzer-malloc-leak]: leak of 'hanja'
#   433|   		char* comment = strtok_r(NULL, "\r\n", &save);
#   434|   
#   435|-> 		Hanja* hanja = hanja_new(p, value, comment);
#   436|   
#   437|   		if (*list == NULL) {
2. Defect type: GCC_ANALYZER_WARNING
1. libhangul-0.1.0/hangul/hanja.c:0: scope_hint: In function 'hanja_list_append_n'
2. libhangul-0.1.0/hangul/hanja.c:389:19: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
#   387|   	for (i = 0; i < n ; i++)
#   388|   	    list->items[list->len + i] = hanja + i;
#   389|-> 	list->len += n;
#   390|       }
#   391|   }
3. Defect type: GCC_ANALYZER_WARNING
1. libhangul-0.1.0/hangul/hanja.c:0: scope_hint: In function 'hanja_list_reserve'
2. libhangul-0.1.0/hangul/hanja.c:358:12: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
#   356|   hanja_list_reserve(HanjaList* list, size_t n)
#   357|   {
#   358|->     size_t size = list->alloc;
#   359|   
#   360|       if (n > SIZE_MAX / sizeof(list->items[0]) - list->len)

Does the above defect mean some issue or just false alert?

COPYRIGHT

libhangul 과 libhangul 을 이용해 개발한 BeOS/Haiku 용 한글 입력기를 Haiku 용으로 패키징 작업 중입니다.
COPYRIGHT 문구가 필요한데 깃헙에는 아무리 찾아보아도 보이지 않네요.
뭐라고 적으면 좋을지 알려주시거나 COPYRIGHT 파일을 추가해주시면 감사하겠습니다.

한자(漢字) 목록에 데이터 추가 건의

한자(漢字) 목록에

국립국어원 한국어기초사전 https://krdict.korean.go.kr/

한국민족문화대백과사전 https://encykorea.aks.ac.kr
에서 공개한

한국민족문화대백과사전 텍스트 콘텐츠 메타데이터 (20190325) https://www.data.go.kr/dataset/3059498/fileData.do?lang=ko

위의 데이터 중 한자(漢字) 변환 데이터를 추가하여 적용할까 합니다.

일단, 위의 사전 목록에서 한글-한자(漢字) 매핑하는 부분을 정리후, 커밋을 할려고 합니다.

정리완료 및 커밋후 검토완료되면 이슈 닫겠습니다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.