trime icon indicating copy to clipboard operation
trime copied to clipboard

[bug] Including the character (U+0027, APOSTROPHE) in "speller/alphabet" changes the keyboard layout for the schema

Open rodrigomorales1 opened this issue 2 months ago • 2 comments

  • Brief description of the bug
  • Experiment
  • System information
  • Personal thoughts
  • Additional information

I'm not a Chinese native speaker, but I'm learning Chinese and I like using RIME.

Brief description of the bug

When the key speller/alphabet in an schema contains the character ' (U+0027, APOSTROPHE), the keyboard layout is changed for that specific schema.

The screenshot below shows the keyboard layout that is used for a schema that doesn't include the character ' (U+0027, APOSTROPHE) in speller/alphabet.

image

The screenshot below shows the keyboard layout that is used for a schema that includes the character ' (U+0027, APOSTROPHE) in speller/alphabet.

image

See section "Experiment" for instructions on how to reproduce this issue.

Experiment

I downloaded com.osfans.trime-v3.2.18-0-gc10e2e84-arm64-v8a-release.apk from https://github.com/osfans/trime/releases/tag/v3.2.18 and installed it on my Android device.

I removed all files in /storage/emulated/0/rime to avoid other files interfering with this experiment.

ssh phone-samsung 'rm -rf /storage/emulated/0/rime && mkdir /storage/emulated/0/rime'

I cloned rime-prelude in my desktop computer.

rm -rf /tmp/rime \
  && mkdir /tmp/rime \
  && cd /tmp/rime \
  && git clone --branch master --depth 1 'https://github.com/rime/rime-prelude'

I created some simple schemas and dictionaries to demostrate this bug.

/tmp/rime/foo.dict.yaml (see code block below)

---
name: foo
version: 1
sort: original
...
111	a
222	ab
333	abc

/tmp/rime/foo.schema.yaml (see code block below)

schema:
  schema_id: foo
  name: Schema foo
  version: 1

engine:
  processors:
  - ascii_composer
  - selector
  - key_binder
  - speller
  - selector
  - navigator
  - express_editor
  segmentors:
  - ascii_segmentor
  - abc_segmentor
  - punct_segmentor
  - fallback_segmentor
  translators:
  - table_translator

speller:
  alphabet: "abc"
  auto_select: false

translator:
  dictionary: foo
  enable_user_dict: false

key_binder:
  import_preset: default

/tmp/rime/bar.schema.yaml (see code block below)

---
name: bar
version: 1
sort: original
...
111111	a
222222	ab
333333	abc

/tmp/rime/bar.schema.yaml (see code block below)

schema:
  schema_id: bar
  name: Schema bar
  version: 1

engine:
  processors:
  - ascii_composer
  - selector
  - key_binder
  - speller
  - selector
  - navigator
  - express_editor
  segmentors:
  - ascii_segmentor
  - abc_segmentor
  - punct_segmentor
  - fallback_segmentor
  translators:
  - table_translator

speller:
  alphabet: "abc"
  auto_select: false

translator:
  dictionary: bar
  enable_user_dict: false

key_binder:
  import_preset: default

/tmp/rime/baz.dict.yaml (see code block below)

---
name: baz
version: 1
sort: original
...
111111111	a
222222222	ab
333333333	abc

/tmp/rime/baz.schema.yaml (see code block below)

schema:
  schema_id: baz
  name: Schema baz
  version: 1

engine:
  processors:
  - ascii_composer
  - selector
  - key_binder
  - speller
  - selector
  - navigator
  - express_editor
  segmentors:
  - ascii_segmentor
  - abc_segmentor
  - punct_segmentor
  - fallback_segmentor
  translators:
  - table_translator

speller:
  alphabet: "abc'"
  auto_select: false

translator:
  dictionary: baz
  enable_user_dict: false

key_binder:
  import_preset: default

/tmp/rime/default.custom.yaml (see code block below)

patch:
  schema_list:
  - schema: foo
  - schema: bar
  - schema: baz

I used the folowing command to transfer the *.yaml files from my desktop computer to my Android device into the directory that Trime searches files.

rsync -Pvv \
  /tmp/rime/rime-prelude/default.yaml \
  /tmp/rime/rime-prelude/key_bindings.yaml \
  /tmp/rime/rime-prelude/punctuation.yaml \
  /tmp/rime/rime-prelude/symbols.yaml \
  /tmp/rime/foo.schema.yaml \
  /tmp/rime/foo.dict.yaml \
  /tmp/rime/bar.schema.yaml \
  /tmp/rime/bar.dict.yaml \
  /tmp/rime/baz.schema.yaml \
  /tmp/rime/baz.dict.yaml \
  /tmp/rime/default.custom.yaml \
  phone-samsung:/storage/emulated/0/rime

I enabled the schemas in Trime. After the message Deploying... disappeared, I opened an application to input text.

The following screenshot shows the keyboard layout when using Schema foo.

image

The following screenshot shows the keyboard layout when using Schema bar.

image

The following screenshot shows the keyboard layout when using Schema baz.

image

As you can see above, Schema foo and Schema bar use the same keyboard layout. However, Schema baz use a different keyboard layout.

System information

I used the latest release as of time of writing: I installed com.osfans.trime-v3.2.18-0-gc10e2e84-arm64-v8a-release.apk which I downloaded from https://github.com/osfans/trime/releases/tag/v3.2.18.

Personal thoughts

I believe this is a bug because the value of speller/alphabet shouldn't affect the keyboard layout.

In my opinion, having two different keyboard layouts for different input methods is not convenient because the user has to remember the position of the keys for two different keyboard layouts.

When I use RIME in my desktop computer, I use the same keyboard for all input methods.

Additional information

I installed version 3.2.17 com.osfans.trime-nightly-0-g98e201b9-arm64-v8a-release.apk which I downloaded from https://github.com/osfans/trime/releases/tag/v3.2.17 and I could reproduce the same issue.

I installed version 3.2.16 (trime-3.2.16-arm64-v8a-debug.apk which I downloaded from https://github.com/osfans/trime/releases/tag/v3.2.16) and I couldn't reproduce this issue.

Therefore, I believe that version 3.2.17 introduced some changes that caused this bug.

rodrigomorales1 avatar Jun 28 '24 04:06 rodrigomorales1