Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] Record frequency on correctly spelled words only #470

Closed
sathieu opened this issue Nov 30, 2023 · 6 comments
Closed

[ENHANCEMENT] Record frequency on correctly spelled words only #470

sathieu opened this issue Nov 30, 2023 · 6 comments

Comments

@sathieu
Copy link

sathieu commented Nov 30, 2023

Is your feature request related to a problem? Please describe.

I've installed ibus-typing-browser for my children who are learning words.

With record mode disabled, most of the suggested words are useless because previously typed words are not recorded.

With record mode enabled, words with wrong spelling are added and later suggested.

Describe the solution you'd like

Record only when last typed word is in dictionary.

Describe alternatives you've considered

Cleaning up the DB from time to time.

Additional context

@mike-fabian
Copy link
Owner

That is a very interesting idea!

Personally I sometimes want to record words which are not in dictionaries for special purposes. But not always, and even I probably want to only record words from dictionaries most of the time.

So maybe a new option

☑️ Record only words which are n dictionaries

would be good?

By the way, currently you can already manually remove unwanted suggestions from the database, the default key binding for this is

remove_candidate_1 ['Control+1', Control+KP_1', Control+F1']

Also, the database is cleaned up a bit already at each restart of ibus-typing-booster, a few entries which have not been used much and have not been used for a long time are removed. Currently there is a hardcoded limit of 50000 entries for the database, if that limit is exceeded, old entries (not used for a long time) are removed until no more than 50000 entries remain. On top of that, no matter how many entries there are in the database, 0.1% of oldest (least used) entries are removed immediately if they have been used only once and if they have been used more than once their usage count is cut in half. So mispelled entries will eventually fade out and disappear automatically althought that can take some time.

So maybe such a new option is a good idea.

@mike-fabian mike-fabian added this to To do in Mike’s github project board via automation Dec 1, 2023
@sathieu
Copy link
Author

sathieu commented Dec 1, 2023

@mike-fabian Thanks for the detail.

Maybe the option can be named Record mode with the following possible values:

  • Dictionaries (Record correctly spelled words)
  • Dictionaries and User database (Record correctly spelled words or words already in the DB)
  • All (current behavior)

@mike-fabian
Copy link
Owner

There is already a checkbox option

☑️ Off the record mode

If that is checked, nothing is recorded in the user database.
Maybe, I shoud change this option into a combobox options

Record mode [All | Dictionaries and user database | Dictionaries | Nothing]

Advantage:

  • Saves space in the setup tool, no extra line is added. The setup tool is already quite big, adding one more vertical line makes it not fit on 1024x768 screens anymore.
  • Having two different options to influence the recording might be confusing, it might be better to have only one option controlling how much is recorded.

Disadvantage:

  • Users who were used to the old option need to adapt to the new system.
  • Currently there is a command toggle_off_the_record with the default keybinding Mod5+F9, I need to think about what to do with that command.

I am thinking about the details how this should work.

mike-fabian added a commit that referenced this issue Jan 30, 2024
Resolves: #470

Chooses which words to record (words are called “phrases” in the source code for historic reasons):

    0: Everything
    1: Correctly spelled or previously recorded
    2: Correctly spelled
    3: Nothing

I left the existing option

    ☑️ Off the record mode

there for the moment. It works as it always did. Setting the new
“Record mode” option to 3 and checking “Off the record mode” does the
same thing so this seems a bit redundant.  But the advantage is that
one can quickly toggle recording to off using “Off the record mode”
with a keybinding and when toggling it on again return to the
operation of the selected “Record mode” in the combobox option.

I could maybe remove the option “3: Nothing” from the combobox to remove redundancy…

As I added one more row to the options tab of the setup tool, I saved one
row by putting the two buttons

[ Learn from text file ] [ Delete learned data ]

into the same row.
@mike-fabian
Copy link
Owner

I have implemented a new combobox option “Record mode” now.

It chooses which words to record

0: Everything
1: Correctly spelled or previously recorded
2: Correctly spelled
3: Nothing

I left the existing option

☑️ Off the record mode

there for the moment. It works as it always did. Setting the new
“Record mode” option to 3 and checking “Off the record mode” does the
same thing so this seems a bit redundant. But the advantage is that
one can still quickly toggle recording to off using “Off the record mode”
with a keybinding and when toggling it on again return to the
operation of the selected “Record mode” in the combobox option.
I could hide the ☑️ Off the record mode and still make the keybinding
to toggle “Off the record mode” work but I tend to think now that would
just obfuscate things.

I could maybe remove the option “3: Nothing” from the combobox to remove redundancy…

On the other hand that redundancy doesn’t hurt.

As I added one more row to the options tab of the setup tool, I saved one
row by putting the two buttons

[ Learn from text file ] [ Delete learned data ]

into the same row.

@mike-fabian
Copy link
Owner

Test builds of ibus-typing-booster-2.24.13 with the new feature are available for Fedora 38, 39, and rawhide here:

https://copr.fedorainfracloud.org/coprs/mfabian/ibus-typing-booster/builds/

and for openSUSE here:

https://build.opensuse.org/package/show/home:mike-fabian/ibus-typing-booster

Can you please test this?

Is the wording of the option values OK? Is the text of the tooltip shown when hovering with the mouse over the option OK?:

        self._record_mode_label.set_tooltip_text(
            _('Selects which kind of input should be recorded in the user '
              'database: everything, only correctly spelled words or words '
              'which have been previously recorded in the user database, only '
              'correctly spelled words, or nothing.'))

mike-fabian added a commit that referenced this issue Jan 31, 2024
Resolves: #470

Chooses which words to record (words are called “phrases” in the source code for historic reasons):

    0: Everything
    1: Correctly spelled or previously recorded
    2: Correctly spelled
    3: Nothing

I left the existing option

    ☑️ Off the record mode

there for the moment. It works as it always did. Setting the new
“Record mode” option to 3 and checking “Off the record mode” does the
same thing so this seems a bit redundant.  But the advantage is that
one can quickly toggle recording to off using “Off the record mode”
with a keybinding and when toggling it on again return to the
operation of the selected “Record mode” in the combobox option.

I could maybe remove the option “3: Nothing” from the combobox to remove redundancy…

As I added one more row to the options tab of the setup tool, I saved one
row by putting the two buttons

[ Learn from text file ] [ Delete learned data ]

into the same row.
@mike-fabian mike-fabian moved this from To do to In progress in Mike’s github project board Feb 1, 2024
Mike’s github project board automation moved this from In progress to Done Feb 6, 2024
@mike-fabian
Copy link
Owner

New option is included in ibus-typing-booster 2.25.0:
https://github.com/mike-fabian/ibus-typing-booster/releases/tag/2.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants