AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1053182
Accepted
Patrick Trentin
Patrick Trentin
Asked: 2018-07-09 00:27:07 +0800 CST2018-07-09 00:27:07 +0800 CST 2018-07-09 00:27:07 +0800 CST

选择数字并不总是返回带有 ibus 拼音的汉字

  • 772

我在 Ubuntu 中使用智能拼音键盘 1 将中文字符输入到我的文档中。ibus

其input-method设计方式是,可以键入pinyin与字符相关联的字符,然后可以使用数字从字符列表中选择它0-9在键盘上。

例子:

在此处输入图像描述


问题:在上周,有时会发生当我按数字时0-9输入法不会产生汉字而是我按的数字。此外,任何进一步的键盘输入都不会被解释为 ibus 的输入,而只是按原样写在屏幕上,直到我pinyin再次手动切换输入模式。

我按顺序尝试了什么:

  • 重启
  • 去掉输入法配置,重新添加
  • 重新安装 ibus 拼音

这些似乎都没有帮助。

问:有谁知道如何解决这个问题?


附带说明一下,里面似乎有一个*ibus-engine-libpinyin.*.crash文件/var/crash可能与这个问题有关。但是,我不确定如何在线跟踪这个错误报告,看看它是否已经有在线解决方案。

编辑:我目前的解决方法是使用fcitx而不是ibus.. 虽然这并不能真正解决软件中的问题。

1 智能拼音键盘可以通过调用安装sudo apt-get install ibus-libpinyin在中文All Setting-->Text Entry-->Input sources to use-->+(智能拼音)(Ibus)中。

keyboard input-method ibus chinese pinyin
  • 2 2 个回答
  • 1967 Views

2 个回答

  • Voted
  1. Best Answer
    林果皞
    2018-10-28T14:46:03+08:002018-10-28T14:46:03+08:00

    TL;博士: rm ~/.cache/ibus/libpinyin/*

    长答案:

    我有类似的问题,除了我的问题无法在下一列中返回任何汉字>。

    我做的第一件事是watch -n 3 -d 'ps auxww|tac' 比较成功(第一列)和失败(下一列)发生时输出之间的区别。

    我很快注意到它/usr/lib/ibus/ibus-engine-libpinyin --ibus仍然在成功运行,但在失败时消失。

    在此处输入图像描述

    这意味着/usr/lib/ibus/ibus-engine-libpinyin --ibus在下一列中选择字符时进程崩溃。

    由于之前的进程没有了,而Super+Space要切换新的libpinyin进程,选择第一列,然后ps auxww在另一个终端运行知道最新pid的是6798,运行sudo strace -ff -vvv -p 6798 -s 1000000了解进程:

    [pid  6798] lseek(14, 12288, SEEK_SET)  = 12288
    [pid  6798] read(14, "", 4096)          = 0
    [pid  6798] write(2, "ibus-engine-libpinyin: ../src/lookup/phonetic_lookup.h:901: bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArray]: Assertion `m_user_bigram->store(last_token, user)' failed.\n", 323) = 323
    [pid  6798] mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f59a80e2000
    [pid  6798] rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
    [pid  6798] rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
    [pid  6798] getpid()                    = 6798
    [pid  6798] gettid()                    = 6798
    [pid  6798] tgkill(6798, 6798, SIGABRT) = 0
    [pid  6798] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    [pid  6798] --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=6798, si_uid=1000} ---
    [pid  6800] <... poll resumed> <unfinished ...>) = ?
    [pid  6799] <... restart_syscall resumed>) = ?
    [pid  6800] +++ killed by SIGABRT (core dumped) +++
    [pid  6799] +++ killed by SIGABRT (core dumped) +++
    +++ killed by SIGABRT (core dumped) +++
    

    在下一列中选择字符后,strace 输出停止。现在我知道这是核心转储了。另一种方法是调试tail -f /var/log/syslog以知道它是systemd-coredump.

    所以我跑coredumpctl list知道相关的核心转储pid是6798:

    Sun 2018-10-28 06:18:31 +08    6798  1000  1000   6 present   /usr/lib/ibus/ibus-engine-libpinyin
    

    我运行coredumpctl dump 6798 --output alamak将 coredump 保存到 alamak 文件中,然后运行gdb -q /usr/lib/ibus/ibus-engine-libpinyin alamak(可执行路径可以从ps auxwwor获取coredumpctl list)来检查 coredump 文件:

    xb@dnxb:~$ gdb -q /usr/lib/ibus/ibus-engine-libpinyin alamak
    expansion:  History expansion on command input is on.
    filename:  The filename in which to record the command history is "/home/xiaobai/.gdb_history".
    remove-duplicates:  The number of history entries to look back at for duplicates is 0.
    save:  Saving of the history record on exit is on.
    size:  The size of the command history is 10000000.
    Reading symbols from /usr/lib/ibus/ibus-engine-libpinyin...(no debugging symbols found)...done.
    
    warning: core file may not match specified executable file.
    [New LWP 6798]
    [New LWP 6800]
    [New LWP 6799]
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `/usr/lib/ibus/ibus-engine-libpinyin --ibus'.
    Program terminated with signal SIGABRT, Aborted.
    #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
    [Current thread is 1 (Thread 0x7f59a80971c0 (LWP 6798))]
    

    尝试导航下一页,我可以看到一些有趣的关键字,与之前thread apply all bt full的输出相同:Enterstracewrite()

    (gdb) thread apply all bt full
    
    Thread 3 (Thread 0x7f59a36a9700 (LWP 6799)):
    ...
    #1  0x00007f59a67cd801 in __GI_abort () at abort.c:79
            save_stage = 1
            act = 
              {__sigaction_handler = {sa_handler = 0x555b8ce58800, sa_sigaction = 0x555b8ce58800}, sa_mask = {__val = {0, 18446744073709551600, 0, 0, 0, 140733365772904, 0, 140733365772736, 140023023567312, 21474836480, 140023023552472, 0, 2476426370025201152, 140023023537428, 0, 140023023552472}}, sa_flags = -1488188568, sa_restorer = 0x7f59a74c0c00}
            sigs = {__val = {32, 0 <repeats 15 times>}}
    #2  0x00007f59a67bd39a in __assert_fail_base (fmt=0x7f59a69447d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f59a74c0c00 "m_user_bigram->store(last_token, user)", file=file@entry=0x7f59a74c0b68 "../src/lookup/phonetic_lookup.h", line=line@entry=901, function=function@entry=0x7f59a74c14e0 "bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArra"...) at assert.c:92
            str = 0x555b8ce58800 ""
            total = 4096
    #3  0x00007f59a67bd412 in __GI___assert_fail (assertion=0x7f59a74c0c00 "m_user_bigram->store(last_token, user)", file=0x7f59a74c0b68 "../src/lookup/phonetic_lookup.h", line=901, function=0x7f59a74c14e0 "bool pinyin::PhoneticLookup<nbest>::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; MatchResult = _GArray*; GArray = _GArra"...) at assert.c:101
    #4  0x00007f59a7476a71 in pinyin_train () at /usr/lib/x86_64-linux-gnu/libpinyin.so.13
    #5  0x0000555b8c7e5689 in  ()
    

    现在导致核心转储的主要关键字已经被确认,谷歌const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*,将找到这个错误报告线程:

    我在终端运行 libpinyin 并收到以下错误消息:

    debian-user:~$ /usr/lib/ibus/ibus-engine-libpinyin --ibus ibus-engine-libpinyin: ../src/lookup/phonetic_lookup.h:901: bool pinyin::PhoneticLookup::train_result3(const pinyin::PhoneticKeyMatrix*, const pinyin::ForwardPhoneticConstraints*, MatchResult) [with int nbest = 3; 匹配结果 = _GArray*; GArray = _GArray]:断言 `m_user_bigram->store(last_token, user)' 失败。中止

    所以这个错误与用户数据有关。当您选择第一个以外的短语时,libpinyin 将尝试将其存储在您的主文件夹中。如果它不起作用,它将失败并退出。

    您可能需要检查 ~/.cache/ibus/libpinyin/ 中的内容。我只是删除了该文件夹中的所有文件并杀死 ibus-engine-libpinyin 进程以重新启动它。他们的事情又恢复了正常。我想你遇到的问题很可能和我的一样。如果不是,请在终端运行 ibus-engine-libpinyin 时提供错误消息

    ...

    我按照您的指示删除了 ~./cache/ibus/libpinyin 文件夹。问题解决了。

    就是这样,运行rm ~/.cache/ibus/libpinyin/*,它解决了问题。

    • 9
  2. Christianus
    2018-07-19T14:36:32+08:002018-07-19T14:36:32+08:00

    1.

    此外,任何进一步的键盘输入都不会被解释为 ibus 的输入,而只是按原样写在屏幕上,直到我再次手动将输入模式切换为拼音。

    在SunPinyin(带ibus输入)中,您可以设置输出的初始状态为英文/中文。它不适用于IBus Pinyin 1.5.0.

    2. 至少在crash修复之前作为权宜之计,可以尝试使用Google Pinyin, WubiPinyin, SunPinyinor Pinyinunder fcitx,这样可以更好的管理罗马化的输入法。

    sudo apt install fcitx fcitx-googlepinyin fcitx-table-wbpy fcitx-pinyin fcitx-sunpinyin
    

    您需要更改输入法fcitx并System Settings --> Language Support重新启动系统(在我的情况下注销/登录就足够了)。托盘图标将显示keyboard( fcitx) 代替En/ Ru/Pl按钮 ( ibus)。

    然后查找Google Pinyin、或in WubiPinyin,键入中文以缩小列表。SunPinyinPinyinAll Setting --> Text Entry --> Input sources to use --> +

    3.(临时便利)按下Shift可以手动更改输入以及标点符号等。检查:All Settings --> Text Entry --> Input source --> Preferences --> Shortcuts分配适当的快捷方式。

    • 1

相关问题

  • 有哪些有用的键盘快捷键?[关闭]

  • 如何在 Compiz->Commands 中获得超过 12 个命令?[关闭]

  • 输入语言切换键只接受 shift-alt 而不是 alt-shift [关闭]

  • 如何在键盘上映射未映射的键?[关闭]

  • 如何重置我的键盘布局?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve