Git Product home page Git Product logo

fcitx5-mcbopomofo's People

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

fcitx5-mcbopomofo's Issues

Error confronted when running "make"

Recently, I would like to install fcitx5-mcbopomofo on my Ubuntu 22.04.3 LTS.
I installed all the required packages.
After following the commands:

cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
make

I confronted an error when the progress is about 46%.
The error information is like this:

[ 44%] Building CXX object src/CMakeFiles/mcbopomofo.dir/McBopomofo.cpp.o
[ 46%] Linking CXX shared module mcbopomofo.so
/usr/bin/ld: libMcBopomofoLib.a(DictionaryService.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v8::format<>(fmt::v8::basic_format_string<char>)':
/usr/include/fmt/core.h:3119: undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: /usr/include/fmt/core.h:3119: undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
/usr/bin/ld: libMcBopomofoLib.a(DictionaryService.cpp.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v8::format<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(fmt::v8::basic_format_string<char, fmt::v8::type_identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&>::type, fmt::v8::type_identity<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>::type>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/fmt/core.h:3119: undefined reference to `fmt::v8::vformat[abi:cxx11](fmt::v8::basic_string_view<char>, fmt::v8::basic_format_args<fmt::v8::basic_format_context<fmt::v8::appender, char> >)'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/mcbopomofo.dir/build.make:107:src/mcbopomofo.so] 錯誤 1
make[1]: *** [CMakeFiles/Makefile2:346:src/CMakeFiles/mcbopomofo.dir/all] 錯誤 2
make: *** [Makefile:146:all] 錯誤 2

May you help me how to solve this problem?

更新 Fedora 安裝說明 (支援 Fedora 39)

上次在 #77 提供的安裝說明需要更新

在第一部安裝套件的部分,更新為

sudo dnf install fcitx5 fcitx5-configtool \
                 fcitx5-devel cmake extra-cmake-modules gettext fmt-devel libicu-devel json-c-devel

變更部分:

  • 新增必要相依套件:libicu-develjson-c-devel
  • 移除 fcitx5-autostart

附註說明:

  • fcitx5-autostart 為 X11 用的開機啟動, Wayland 現在不需安裝此套件,設定方式請參考 fcitx5 wiki

Persist UserOverrideModel

As discussed in #63, now that we've improved the effectiveness of UOM, it seems valuable to persist the model.

Obviously we don't want to save to disk every time we observe a user override, and so we need some rate limiting.

We never come up with a way to (de)serialize the UOM, and so that also needs addressing.

We should check if the disk write needs to be async—may be an overkill if the UOM (even at full capacity) is always small.

Proposal: reformat the code in src/Engine to using Google C++ style

For the longest time the C++ code of McBopomofo was written (very loosely) in the WebKit style. Now that a lot of C++ work is actively done in fcitx5-mcbopomofo (then it gets synced over to McBopomofo, the macOS project), I think we can unify the style by making a one-time PR both here and to the macOS project. Compared to other files in fcitx5-mcbopomofo, those in src/Engine/ excluding gramambular2 and Mandarin are the only ones that still follow the WebKit style.

One additional benefit is that we can run cpplint over the reformatted code.

處理 Chrome 系列瀏覽器吃字的問題

在使用 Chrome 引擎的瀏覽器當中打字時,如果對 fcitx5 的 input context 呼叫了 commitString() API 的話,那麼輸入法引擎就會收到一個 focus out 事件,並且呼叫到 reset() 方法。

如果我們真的在 reset() 方法中,清除掉了目前用戶輸入的注音 reading 以及 composing buffer,由於小麥的邏輯是注音 reading 超過上限之後,就會用 commitString 輸入超過上限的部分,如果這時候因為 focus out 而被清除,就會有種用戶打字到一半,有些字直接不見的狀況,而造成用戶難以輸入整段文字。另一方面,用戶在使用 Chrome 系列瀏覽器(包括 Chrome、Chromium、MS Edge、Sidekick 等)以及 Electron 瀏覽器打字的場合,真的非常多。

目前先暫時寫死幾組需要忽略 focus out 的瀏覽器,但我們應該把這應該排除的 app 做得更靈活些。

Recommend using Ninja to build fcitx5-mcbopomofo

I wonder if we would like to recommend using ninja to build the project.

To enable ninja, simply add -G Ninja to the CMake command.

cmake ../ -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DENABLE_CLANG_TIDY=On
cmake --build .
# or just `ninja`

I observed a ~2x boost on my system ( Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz)

# ninja uses $(nproc) +2 jobs by default
$ nproc 
16

$ time ninja
[40/40] Linking CXX shared module src/mcbopomofo.so

real    0m22.833s
user    2m46.923s
sys     0m4.956s
$ time make -j 18
...
[100%] Built target mcbopomofo

real    0m48.043s
user    2m9.943s
sys     0m4.526s

Ensure macros in McBopomofo macOS and fcitx5-mcbopomofo are in sync

Two concerns from maintenance perspective:

  • We want to make sure that macros introduced on one platform are supported in another; if not always feasible, McBopomofoLM should be modified such that unsupported macros are removed from the candidtae list
  • Making changes to data.txt in fcitx5-mcbopomofo are not sustainable, since any sync with the upstream could cause changes to be overwritten

For now I can see some short-term solutions:

  • Require that changes to data.txt are also reflected in the upstream data source
  • Have a unit test (maybe just a Python script) that checks macros extracted from fcitx5-mcbopomofo source satisfy those in data.txt

Add a "C++ style" section to README

I'll update the README later. I'm thinking:

  • We use modified Google C++ style—there's a .clang-format at the top level and we encourage (or require?) contributors to clang-format their code. We deviate from the style in these few items:
    • No snake_case_variable, so no such local variables, member variables, or parameter names.
    • Methods do not begin with uppercase letters, so Foo::doSomething(), and never Foo::DoSomething. That applies to both instance and static member functions.
  • Code inside Engine/ (but not its subdirectories) follow WebKit style for historical reasons, and we should keep using that style. Another .clang-format is supplied there.
  • We also encourage contributors to use cpplint to check for common issues.

TODO: Add WebKit .clang-format to Engine/ and Google C++ Style .clang-format to Mandarin and Gramambular.

多餘注音輸入 [Dup](https://github.com/openvanilla/McBopomofo/issues/409)

在您回報問題之前,建議也可以先參考 Wiki 上的 常見問題使用手冊

摘要
請簡單說明您遇到了什麼問題。這份表格雖然是中文的(我們相信注音輸入法的用戶應該都能看懂中文),但開發團隊可以使用中英文溝通,您也可以使用英文回報問題。

快速分類
請問您遇到的是:

  • 當機或應用程式閃退
  • 輸入法叫不出來,或無法正確輸出中文
  • 無法切換到特定功能
  • 輸入法效能有問題(執行速度太慢/電腦發燙)
  • UI 顯示不正常
  • 其他

問題發生步驟

  1. 打開 任何 app
  2. 開始在 任何可以打字的地方 區域打字
  3. 若欲輸出注音就會點擊打字的地方
  4. 注音即輸出兩次

預期正常狀況
輸出一次注音

螢幕截圖或螢幕錄製
螢幕錄影 20231229(1).webm

電腦環境
請問您在怎樣的環境遇到這個問題?

  • 小麥注音版本:(請填寫版本)
  • 鍵盤樣式:
    • 標準
    • 倚天
    • 許氏
    • 倚天 26 鍵
    • 漢語拼音
    • IBM
      Operating System: Arch Linux
      KDE Plasma Version: 5.90.0
      KDE Frameworks Version: 5.246.0
      Qt Version: 6.6.1
      Kernel Version: 6.6.8-zen1-1-zen (64-bit)
      Graphics Platform: Wayland
      Processors: 16 × AMD Ryzen 7 7735HS with Radeon Graphics
      Memory: 14.9 GiB of RAM
      Graphics Processor: AMD Radeon Graphics
      Manufacturer: COPELION INTERNATIONAL INC.
      Product Name: FORGE 16
      System Version: Version 1.0
  • 特殊設定: 無

無法以小數字鍵盤選擇候選字

在您回報問題之前,建議也可以先參考 Wiki 上的 常見問題使用手冊

摘要
請簡單說明您遇到了什麼問題。這份表格雖然是中文的(我們相信注音輸入法的用戶應該都能看懂中文),但開發團隊可以使用中英文溝通,您也可以使用英文回報問題。

快速分類
請問您遇到的是:

  • 當機或應用程式閃退
  • 輸入法叫不出來,或無法正確輸出中文
  • 無法切換到特定功能
  • 輸入法效能有問題(執行速度太慢/電腦發燙)
  • UI 顯示不正常

問題發生步驟

  1. 打開 任何 app
  2. 開始在 任何可以打字的地方 區域打字
  3. 若欲輸出注音就會點擊打字的地方
  4. 按開始選字
  5. 使用數字鍵盤選字

預期正常狀況
輸出一次注音

螢幕截圖或螢幕錄製
無法

電腦環境

  • 小麥注音版本:(請填寫版本)
  • 鍵盤樣式:
    • 標準
    • 倚天
    • 許氏
    • 倚天 26 鍵
    • 漢語拼音
    • IBM
      Operating System: Arch Linux
      KDE Plasma Version: 5.90.0
      KDE Frameworks Version: 5.246.0
      Qt Version: 6.6.1
      Kernel Version: 6.6.8-zen1-1-zen (64-bit)
      Graphics Platform: Wayland
      Processors: 16 × AMD Ryzen 7 7735HS with Radeon Graphics
      Memory: 14.9 GiB of RAM
      Graphics Processor: AMD Radeon Graphics
      Manufacturer: COPELION INTERNATIONAL INC.
      Product Name: FORGE 16
      System Version: Version 1.0
  • 特殊設定: 無

Fedora 37 安裝說明

最近在嘗試 fedora 然後想安裝小麥輸入法,目前有試出一個安裝的方案。
方法跟 Readme 上的差不多,只差在相依安裝的方式不同

  1. 安裝 fcitx5, CMake, 以及以下開發用模組:
sudo dnf install fcitx5 fcitx5-configtool fcitx5-autostart fcitx5-devel cmake extra-cmake-modules gettext fmt-devel
  1. 然後在本專案的 git 目錄下執行以下指令:
mkdir -p build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
make
sudo make install

不會自動建立 .local/share/fcitx5/mcbopomofo

在使用 debian 的時候發現的。fcitx5 在載入小麥注音的時候,如果沒有 .local/share/fcitx5/mcbopomofo 這個目錄,就會造成小麥注音載入失敗。建立這個目錄之後重跑 fcitx5 就會成功,但照理說應該要自動建立這個目錄才對。

Feature request: Appstream / Flatpak 支持以及添加到 Flathub

Fcitx 5 是可以支持運作在 flatpak 當中的 (https://flatpak.org/),現在已有不少 Fcitx 5 的其他引擎在 flathub 上

整體代碼來說一般並不需要做任何修改,具體編譯方式和安裝路徑可以參考 https://github.com/fcitx/flatpak-fcitx5/ 的其他任一引擎

因爲 flathub 一般是採取 maintainer 自己提交的方式,因此最好由你們自己申請。至於申請流程可以參考:https://github.com/flathub/flathub/wiki/App-Submission

目前觀察 repo 的文件,主要問題是缺少一個 metainfo 的文件(spec: https://www.freedesktop.org/wiki/Distributions/AppStream/)

隨便舉一例可以參考添加上: https://github.com/fcitx/fcitx5-rime/blob/master/org.fcitx.Fcitx5.Addon.Rime.metainfo.xml.in

即使不考慮支持 flatpak 的使用情況,添加這樣一個文件在被發行版收錄時也會在現行軟件商店中展示(現在GNOME和KDE的軟件商店只展示有appdata的包,而不展示任意發行版的deb package)

(如圖,搜索 fcitx 的結果,這樣的包的展示的名稱說明都來自對應的 metainfo.xml)
图片

相對來講,我認爲 flathub 是一個很方便的能快速讓軟體能被最終用戶用上的方法,例如相對古早的 Ubuntu, 未有提供 fcitx5 的 RHEL 也可以利用 flatpak 運行最新的 fcitx5

Phrase suggestions issue with user-defined pronunciations

Hi,

It seems that if the user has some customized pronunciations for certain characters in their data.txt, it will confuse the phrase suggestion language model with undesired results.

For instance, if I have the following in my data.txt.

丼 ㄉㄨㄥˋ
❤️  ㄒㄧㄣ

The default phrase will include the characters with customized pronunciations, it requires an extra transform (hit the space key) to obtain the desired results.

Default: 丼作
Expected: 動作

image

Default: ❤️苦
Expected: 辛苦
image

Perhaps we can adjust the priority of the default suggestion if there exists some other phrases in the dictionary that match the pronunciation of the entire phrase? E.g., when typing ㄉㄨㄥˋㄗㄨㄛˋ, as 動作 matches the pronunciations of the entire phrase, we provide 動作 as the default.

Refactor test setup

Per #70 (comment) (@Brli), there are a few things we can do to improve the project and CI setup:

  • refactor test suite codes to test/
  • make a test target that runs all tests.

UI hangs on 'Edit User Phrases'

In McBopomofoEngine::McBopomofoEngine, we leverage xdg-open to invoke the user-preferred text editor. However, the desktop environment hangs if system() invokes a synchronous command. For instance, the default text editor on my box is set to vim.

The lambda invoked by fcitx5::SimpleAction will never return since vim is not opened in a proper environment (e.g., terminal emulator).

https://github.com/openvanilla/fcitx5-mcbopomofo/blob/master/src/McBopomofo.cpp#L176-L190

Reproduce:

  1. Set the default text editor to vim.
xdg-mime default vim.desktop text/plain
  1. click "Edit User Phrases" on the menu.

return error when building under directory with permission 1700

the fstab of the directory is as follows:

tmpfs   /home/user/.cache    tmpfs  rw,size=8G,nr_inodes=5k,noexec,nodev,nosuid,uid=user,gid=user,mode=1700 0 0

the return error is:

[100%] Linking CXX executable McBopomofoTest
CMake Error at /usr/share/cmake/Modules/GoogleTestAddTests.cmake:112 (message):
  Error running test executable.                                                                                                                         
                                                                                                                                                         
    Path: '/home/user/.cache/yay/fcitx5-mcbopomofo-git/src/fcitx5-mcbopomofo/build/src/McBopomofoTest'                                                   
    Result: Permission denied                                                                                                                            
    Output:                                                                                                                                              
                                                                                                                                                         
                                                                                                                                                         
Call Stack (most recent call first):                                                                                                                     
  /usr/share/cmake/Modules/GoogleTestAddTests.cmake:225 (gtest_discover_tests_impl)

is it normal?

Suggestion: no need to have your own dvorak implementation

Fcitx5 basically allow you to manage keyboard layout at the same time.

It's even possible even if you want to keep display server layout to non-dvorak and only ues dvorak for certain engines.

(KDE's configtool, qt version has same functionality but different UI).
图片

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.