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

変換操作を改善する #4

Open
marsf opened this issue Feb 19, 2016 · 3 comments
Open

変換操作を改善する #4

marsf opened this issue Feb 19, 2016 · 3 comments

Comments

@marsf
Copy link
Owner

marsf commented Feb 19, 2016

現状では、変換キー (⇌) を押すと、読みの平仮名とカタカナ、JSON データの候補が表示される。

  1. JSON データにカタカナ語が含まれている場合、候補が重複してしまう。カタカナ変換の操作を追加したい。
  2. JSON データの候補が無い場合は、カタカナの候補を表示したい。
  3. 候補選択が一方通行。前の候補に戻れるようにしたい。
@marsf
Copy link
Owner Author

marsf commented Feb 19, 2016

1 と 3 の操作をうまく分けたい。
変換キーを左フリックで前の変換候補、上フリックでカタカナ変換にしてみる。

case 'XFER':
...
    if (aFlickDirection === 'up') {
      // カタカナ候補
      t_str = transChar(tm.targetKana, 'KANA');
    } else if (aFlickDirection === 'left') {
      t_str = tm.getPrevWord();
    } else {
      t_str = tm.getNextWord();
    }

@marsf
Copy link
Owner Author

marsf commented Feb 19, 2016

TransferManager.getPrevWord() はgetNextWord() とほとんど同じ。

@marsf
Copy link
Owner Author

marsf commented Feb 19, 2016

2 は、JSON データの照合前にカタカナ変換の候補を追加していたのを、条件文の else に移動するだけ。

function getTransWords(aStr) {
...
      if (aStr in dicData) {
        results = results.concat(dicData[aStr]);
      } else {
        // カタカナ変換
        results.push(transChar(aStr, 'KANA'));
      }

marsf added a commit that referenced this issue Feb 19, 2016
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

No branches or pull requests

1 participant