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

Unexpected dictionary registration behavior with okuri-ari entry #77

Open
buzztaiki opened this issue Nov 14, 2021 · 1 comment · May be fixed by #78
Open

Unexpected dictionary registration behavior with okuri-ari entry #77

buzztaiki opened this issue Nov 14, 2021 · 1 comment · May be fixed by #78

Comments

@buzztaiki
Copy link

I'm using libskk with fcitx5-skk. When I register ググる to the dictionary as follows, the output after registration will be ググる but ググ.

▼ぐぐ*る【ググ】

Also, The following entry was registered in user.dict.

ぐぐ*る /ググ/

The result of the skk command is as follows:

$ echo -e "G u g u R u G u g u q RET" | skk
{ "input": "G u g u R u G u g u q RET", "output": "ググ", "preedit": "" }
@buzztaiki
Copy link
Author

The following is a test case that reproduces this problem:

static void
save_okuri_ari (void)
{
  SkkContext *context;
  gboolean retval;
  const gchar *preedit;
  const gchar *output;
  SkkCandidate **candidates;
  SkkDict **dictionaries;
  gint len;
  GError *error;

  context = create_context (TRUE, FALSE);

  retval = skk_context_process_key_events (context, "G u g u R u G u g u q RET");
  g_assert (retval);

  output = skk_context_get_output(context);
  g_assert_cmpstr (output, ==, "ググる");

  error = NULL;
  skk_context_save_dictionaries (context, &error);
  g_assert_no_error (error);

  dictionaries = skk_context_get_dictionaries(context, &len);
  g_assert_cmpint (len, ==, 2);

  candidates = skk_dict_lookup (SKK_DICT (dictionaries[1]),
                                "ぐぐr",
                                TRUE,
                                &len);
  g_assert_cmpint (len, ==, 1);
  while (--len >= 0) {
    g_object_unref (candidates[len]);
  }
  g_free (candidates);


  g_object_unref (context);
}

@buzztaiki buzztaiki linked a pull request Nov 19, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant