mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
@@ -1,30 +1,30 @@
|
|||||||
-- require('utf8')
|
--[[--
|
||||||
|
|
||||||
|
# Hangul-input-method Kit for Lua/KOReader
|
||||||
|
|
||||||
|
## Input method implemented: 2-beolsik (for simplicity, can retrieve many articles for implementation)
|
||||||
|
## Classes and their features
|
||||||
|
|
||||||
|
* HgSylbls (= Hangul Syllables)
|
||||||
|
- Determine if a character is in Hangul consonnant, vowel, initial, medial, or final character
|
||||||
|
- Combine initial, medial[, and final] character into a complete syllables
|
||||||
|
- Determine if a medial (or final) character can be a double one (can combine another medial (or final) one)
|
||||||
|
* HgFSM (= Hangul Finite State Machine)
|
||||||
|
- Process Hangul syllabus combination if the character that user inputs are valid one to be combined
|
||||||
|
* UIHandler
|
||||||
|
- To communicate with the actual UI text input box
|
||||||
|
|
||||||
|
## References
|
||||||
|
<https://ehclub.co.kr/2482>
|
||||||
|
:: Hangul syllables combination formula, Hangul unicode composition, FSM reference
|
||||||
|
<https://en.wikipedia.org/wiki/Hangul_consonant_and_vowel_tables>
|
||||||
|
|
||||||
|
--]]
|
||||||
|
|
||||||
local BaseUtil = require("ffi/util")
|
local BaseUtil = require("ffi/util")
|
||||||
local logger = require("logger")
|
local logger = require("logger")
|
||||||
|
|
||||||
--------
|
-- Hangul Syllables
|
||||||
-- # Hangul-input-method Kit for Lua/KOReader
|
|
||||||
--------
|
|
||||||
-- ## Input method implemented: 2-beolsik (for simplicity, can retrieve many articles for implementation)
|
|
||||||
-- ## Classes and their features
|
|
||||||
-- * HgSylbls (= Hangul Syllables)
|
|
||||||
-- - Determine if a character is in Hangul consonnant, vowel, initial, medial, or final character
|
|
||||||
-- - Combine initial, medial[, and final] character into a complete syllables
|
|
||||||
-- - Determine if a medial (or final) character can be a double one (can combine another medial (or final) one)
|
|
||||||
-- * HgFSM (= Hangul Finite State Machine)
|
|
||||||
-- - Process Hangul syllabus combination if the character that user inputs are valid one to be combined
|
|
||||||
-- * UIHandler
|
|
||||||
-- - To communicate with the actual UI text input box
|
|
||||||
--
|
|
||||||
-- ## References
|
|
||||||
-- https://ehclub.co.kr/2482
|
|
||||||
-- :: Hangul syllables combination formula, Hangul unicode composition, FSM reference
|
|
||||||
-- https://en.wikipedia.org/wiki/Hangul_consonant_and_vowel_tables
|
|
||||||
--------
|
|
||||||
|
|
||||||
----------------------
|
|
||||||
-- Hangul Syllables --
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
local HgSylbls = {
|
local HgSylbls = {
|
||||||
-- Hangul character ranges in Unicode
|
-- Hangul character ranges in Unicode
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ end
|
|||||||
--- Returns current version of KOReader.
|
--- Returns current version of KOReader.
|
||||||
-- @treturn int version in the form of a 10 digit number such as `2015110982`
|
-- @treturn int version in the form of a 10 digit number such as `2015110982`
|
||||||
-- @treturn string short git commit version hash such as `704d4238`
|
-- @treturn string short git commit version hash such as `704d4238`
|
||||||
-- @see normalized_version
|
-- @see getNormalizedVersion
|
||||||
function Version:getNormalizedCurrentVersion()
|
function Version:getNormalizedCurrentVersion()
|
||||||
if not self.version or not self.commit then
|
if not self.version or not self.commit then
|
||||||
self.version, self.commit = self:getNormalizedVersion(self:getCurrentRevision())
|
self.version, self.commit = self:getNormalizedVersion(self:getCurrentRevision())
|
||||||
|
|||||||
Reference in New Issue
Block a user