diff --git a/Source/Modules/LanguageParsers/Gramambular/Grid.h b/Source/Modules/LanguageParsers/Gramambular/Grid.h index 6ec59211..5a39fe7a 100644 --- a/Source/Modules/LanguageParsers/Gramambular/Grid.h +++ b/Source/Modules/LanguageParsers/Gramambular/Grid.h @@ -44,9 +44,6 @@ class Grid void insertNode(const Node &node, size_t location, size_t spanningLength); bool hasNodeAtLocationSpanningLengthMatchingKey(size_t location, size_t spanningLength, const std::string &key); - void setRearCursorModeEnabled(bool enabled); - bool RearCursorModeEnabled(); - void expandGridByOneAtLocation(size_t location); void shrinkGridByOneAtLocation(size_t location); @@ -119,19 +116,8 @@ class Grid protected: std::vector m_spans; - bool m_rearCursorMode; }; -inline void Grid::setRearCursorModeEnabled(bool enabled) -{ - m_rearCursorMode = enabled; -} - -inline bool Grid::RearCursorModeEnabled() -{ - return m_rearCursorMode; -} - inline void Grid::clear() { m_spans.clear(); @@ -206,6 +192,7 @@ inline size_t Grid::width() const return m_spans.size(); } +// macOS 10.6 開始的內建注音的游標前置選字風格 inline std::vector Grid::nodesEndingAt(size_t location) { std::vector result; @@ -234,6 +221,8 @@ inline std::vector Grid::nodesEndingAt(size_t location) return result; } +// Windows 版奇摩注音輸入法的游標後置的選字風格。 +// 與微軟新注音相異的是,這個風格允許在詞的中間叫出候選字窗。 inline std::vector Grid::nodesCrossingOrEndingAt(size_t location) { std::vector result; @@ -248,9 +237,7 @@ inline std::vector Grid::nodesCrossingOrEndingAt(size_t location) { for (size_t j = 1, m = span.maximumLength(); j <= m; j++) { - // 左半是漢音模式,已經自威注音 1.5.2 版開始解決了可以在詞中間叫出候選字的問題。 - // TODO: 右半是微軟新注音模式,仍有可以在詞中間叫出候選字的問題。 - if (((i + j != location) && !m_rearCursorMode) || ((i + j < location) && m_rearCursorMode)) + if (i + j < location) { continue; }