[ibus-typing-booster] master: Release 1.2.9 (0238fb2)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 0238fb2240743281b9898084f7bfc5cb31e8261b
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Fri Jan 17 15:40:05 2014 +0100
Release 1.2.9
>---------------------------------------------------------------
ibus-typing-booster/ChangeLog | 11 +++++++++++
ibus-typing-booster/configure.ac | 2 +-
ibus-typing-booster/ibus-typing-booster.pc.in | 2 +-
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/ibus-typing-booster/ChangeLog b/ibus-typing-booster/ChangeLog
index d4d56be..5274b44 100644
--- a/ibus-typing-booster/ChangeLog
+++ b/ibus-typing-booster/ChangeLog
@@ -1,3 +1,14 @@
+* Author: Mike FABIAN <mfabian(a)redhat.com>
+* 17 Jan 2014 Released 1.2.9 version
+* Fix behaviour of arrow right keys in preëdit (Resolves: rhbz#1049324)
+* Add timestamps to entries in the user database
+* Add timestamp support to user_transliteration.py
+* Use a single user database for all engines
+* Add *-inscript2 transliteration options to the Indian languages where these were still missing (Resolves: rhbz#1051405)
+* Make it possible to use multiple hunspell dictionaries at the same time
+* Make it possible to specify a list of dictionaries in the config files
+* Make it possible to get a word back into preëdit by using backspace (Resolves: rhbz#1032442)
+
* Author: Anish Patil <apatil(a)redhat.com>
* 20 Dec 2013 Released 1.2.8 version
* change of IME name for oriya language(#1045299)
diff --git a/ibus-typing-booster/configure.ac b/ibus-typing-booster/configure.ac
index dbee8ca..b8c6c3c 100755
--- a/ibus-typing-booster/configure.ac
+++ b/ibus-typing-booster/configure.ac
@@ -24,7 +24,7 @@ m4_define([package_name], [ibus-typing-booster])
m4_define([ibus_released], [1])
m4_define([ibus_major_version], [1])
m4_define([ibus_minor_version], [2])
-m4_define([ibus_micro_version], [8])
+m4_define([ibus_micro_version], [9])
m4_define(ibus_maybe_datestamp,
m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi]))
diff --git a/ibus-typing-booster/ibus-typing-booster.pc.in b/ibus-typing-booster/ibus-typing-booster.pc.in
index c37c8cd..015a88b 100755
--- a/ibus-typing-booster/ibus-typing-booster.pc.in
+++ b/ibus-typing-booster/ibus-typing-booster.pc.in
@@ -11,7 +11,7 @@ enginedir=/usr/share/ibus/engine
Name: IBus-Typing-Booster
Description: Table Based Input Method Framework for Intelligent Input Bus for Linux / Unix OS
-Version: 1.2.8
+Version: 1.2.9
Requires:
Libs:
Cflags:
\ No newline at end of file
10 years, 5 months
[ibus-typing-booster] master: Make it possible to get a word back into pre��dit by using backspace (80892df)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 80892df55450b26a7b37904e51278de4893d4306
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Dec 19 10:00:34 2013 +0100
Make it possible to get a word back into preëdit by using backspace
Resolves: rhbz#1032442 - [ibus-typing-booster][F20] - Support for the surrounding text needs to be implemented [RFE]
See: https://bugzilla.redhat.com/show_bug.cgi?id=1032442
Implemented *only* for backspace at the moment, not for the arrow keys.
Maybe I’ll do something for the arrow keys later, doing it
for the arrow keys is more tricky but I want to release now
what I already have.
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 34 ++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index 0aebd74..a3f65dd 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -758,6 +758,40 @@ class tabengine (IBus.Engine):
# if the first character is a space, just pass it through
# it makes not sense trying to complete:
return False
+ if key.code in (IBus.KEY_BackSpace,):
+ # When the end of a word is reached again by typing backspace,
+ # try to get that word back into preedit:
+ if not (self.client_capabilities & IBus.Capabilite.SURROUNDING_TEXT):
+ return False
+ surrounding_text = self.get_surrounding_text()
+ text = surrounding_text[0].get_text().decode('UTF-8')
+ cursor_pos = surrounding_text[1]
+ anchor_pos = surrounding_text[2]
+ if not surrounding_text:
+ return False
+ if not self._commit_happened_after_focus_in:
+ # Before the first commit or cursor movement, the
+ # surrounding text is probably from the previously
+ # focused window (bug!), don’t use it.
+ return False
+ pattern = re.compile(r'(^|.*[\s]+)(?P<token>[\S]+)[\s]$', re.UNICODE)
+ match = pattern.match(text[:cursor_pos])
+ if not match:
+ return False
+ # The pattern has matched, i.e. left of the cursor is
+ # a single whitespace and left of that a token was
+ # found. Delete the whitespace and the token from the
+ # application, get the context to the left of the
+ # token, put the token into the preedit again and
+ # update the candidates. Do not pass the backspace
+ # back to the application because the whitespace has
+ # already been deleted.
+ token = match.group('token')
+ self.delete_surrounding_text(-1-len(token),1+len(token))
+ self.get_context()
+ self._editor.insert_string_at_cursor(token)
+ self._update_ui()
+ return True
if key.code >= 32 and (not (key.mask & (IBus.ModifierType.MOD1_MASK | IBus.ModifierType.CONTROL_MASK))):
typed_character = IBus.keyval_to_unicode(key.code).decode('UTF-8')
# If the first character typed is a character which is
10 years, 5 months
[ibus-typing-booster] master: Make it possible to specify a list of dictionaries in the config files (e714cc8)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit e714cc80d51b887f3127f125edbbc9e5fb53ff92
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Fri Jan 17 11:45:09 2014 +0100
Make it possible to specify a list of dictionaries in the config files
The option “hunspell_dict” in the .conf files may now contain not
only a single dictionary but a list, i.e. something like
hunspell_dict = de_DE.dic, en_GB.dic
is now possible.
>---------------------------------------------------------------
ibus-typing-booster/engine/tabsqlitedb.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py
index 39b0deb..0dd5d04 100755
--- a/ibus-typing-booster/engine/tabsqlitedb.py
+++ b/ibus-typing-booster/engine/tabsqlitedb.py
@@ -90,7 +90,7 @@ class tabsqlitedb:
self._normalization_form_internal = 'NFD'
self.hunspell_obj = hunspell_suggest.Hunspell(
- dictionary_names=[self.ime_properties.get("hunspell_dict").replace('.dic', '')])
+ dictionary_names=self.ime_properties.get("hunspell_dict").replace('.dic', '').split(', '))
user_db = 'user.db'
# user database:
10 years, 5 months
[ibus-typing-booster] master: Make it possible to use multiple hunspell dictionaries at the same time (6f769b4)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 6f769b4399c5d11189ebec3d2f80c65b6fe7a59c
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Jan 14 16:08:26 2014 +0100
Make it possible to use multiple hunspell dictionaries at the same time
There is no support in the setup UI for this yet, neither is there
support in the config files, but the code in hunspell_suggest.py has
been generalized now to handle a list of dictionaries instead of only
one.
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_suggest.py | 156 ++++++++++++------------
ibus-typing-booster/engine/hunspell_table.py | 7 +-
ibus-typing-booster/engine/tabsqlitedb.py | 2 +-
3 files changed, 85 insertions(+), 80 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_suggest.py b/ibus-typing-booster/engine/hunspell_suggest.py
index 6a24fea..45e9a74 100755
--- a/ibus-typing-booster/engine/hunspell_suggest.py
+++ b/ibus-typing-booster/engine/hunspell_suggest.py
@@ -37,71 +37,87 @@ except:
max_words = 100
max_words_row = 50
-class Hunspell:
- def __init__(self,loc='/usr/share/myspell/',dict_name='en_US'):
- self.normalization_form_internal = 'NFD'
- self.loc = loc
- self.dict_name = dict_name + '.dic'
- self.aff_name = dict_name + '.aff'
+normalization_form_internal = 'NFD'
+
+class Dictionary:
+ def __init__(self, name=u'en_US'):
+ self.loc = '/usr/share/myspell'
+ self.name = name
self.encoding = 'UTF-8'
- self.dict_buffer = None
- self.aff_buffer = None
+ self.buffer = None
+ self.pyhunspell_object = None
self.load_dictionary()
def load_dictionary(self):
- self.encoding = 'UTF-8'
- self.dict_buffer = None
- self.aff_buffer = None
- self.pyhunspell_object = None
print "load_dictionary() ..."
- if not os.path.isfile(self.loc+self.dict_name) or not os.path.isfile(self.loc+self.aff_name):
- print "load_dictionary(): .dic or .aff file missing."
+ dic_path = os.path.join(self.loc, self.name+'.dic')
+ aff_path = os.path.join(self.loc, self.name+'.aff')
+ if not os.path.isfile(dic_path) or not os.path.isfile(aff_path):
+ print("load_dictionary %(n)s: %(d)s %(a)s file missing."
+ %{'n': self.name, 'd': dic_path, 'a': aff_path})
return
try:
- self.aff_buffer = open(
- self.loc+self.aff_name).read().replace('\r\n', '\n')
+ aff_buffer = open(aff_path).read().replace('\r\n', '\n')
except:
import traceback
traceback.print_exc()
- if self.aff_buffer:
+ if aff_buffer:
encoding_pattern = re.compile(
r'^[\s]*SET[\s]+(?P<encoding>[-a-zA-Z0-9_]+)[\s]*$',
re.MULTILINE|re.UNICODE)
- match = encoding_pattern.search(self.aff_buffer)
+ match = encoding_pattern.search(aff_buffer)
if match:
self.encoding = match.group('encoding')
print "load_dictionary(): encoding=%(enc)s found in %(aff)s" %{
- 'enc': self.encoding, 'aff': self.loc+self.aff_name}
+ 'enc': self.encoding, 'aff': aff_path}
try:
- self.dict_buffer = codecs.open(
- self.loc+self.dict_name).read().decode(self.encoding).replace('\r\n', '\n')
+ self.buffer = codecs.open(
+ dic_path).read().decode(self.encoding).replace('\r\n', '\n')
except:
print "load_dictionary(): loading %(dic)s as %(enc)s encoding failed, fall back to ISO-8859-1." %{
- 'dic': self.loc+self.dict_name, 'enc': self.encoding}
+ 'dic': dic_path, 'enc': self.encoding}
self.encoding = 'ISO-8859-1'
try:
- self.dict_buffer = codecs.open(
- self.loc+self.dict_name).read().decode(self.encoding).replace('\r\n', '\n')
+ self.buffer = codecs.open(
+ dic_path).read().decode(self.encoding).replace('\r\n', '\n')
except:
- print "load_dictionary(): loading %(dic)s as %(enc)s encoding failed, giving up." %{
- 'dic': self.loc+self.dict_name, 'enc': self.encoding}
- self.dict_buffer = None
- self.aff_buffer = None
+ print("load_dictionary(): loading %(dic)s as %(enc)s encoding failed, giving up." %{
+ 'dic': dic_path, 'enc': self.encoding})
+ self.buffer = None
import traceback
traceback.print_exc()
- if self.dict_buffer:
- self.dict_buffer = unicodedata.normalize(
- self.normalization_form_internal, self.dict_buffer)
- if import_hunspell_successful:
- self.pyhunspell_object = hunspell.HunSpell(
- self.loc+self.dict_name,
- self.loc+self.aff_name)
- else:
- self.pyhunspell_object = None
+ return
+ if self.buffer:
+ self.buffer = unicodedata.normalize(
+ normalization_form_internal, self.buffer)
+ if import_hunspell_successful:
+ self.pyhunspell_object = hunspell.HunSpell(
+ dic_path, aff_path)
+ else:
+ self.pyhunspell_object = None
+
+class Hunspell:
+ def __init__(self, dictionary_names=['en_US']):
+ self.dictionary_names = dictionary_names
+ self.load_dictionaries()
+
+ def load_dictionaries(self):
+ self.dictionaries = []
+ for dictionary_name in self.dictionary_names:
+ self.dictionaries.append(Dictionary(name=dictionary_name))
- def words_start(self,word):
- if type(word) != type(u''):
- word = word.decode('utf8')
+ def suggest(self, input_phrase):
+ # If the input phrase is very long, don’t try looking
+ # something up in the hunspell dictionaries. The regexp match
+ # gets very slow if the input phrase is very long. And there
+ # are no very long words in the hunspell dictionaries anyway,
+ # the longest word in the German hunspell dictionary currently
+ # seems to be “Geschwindigkeitsübertretungsverfahren” trying
+ # to match words longer than that just wastes time.
+ if len(input_phrase) > 40:
+ return []
+ if type(input_phrase) != type(u''):
+ input_phrase = input_phrase.decode('utf8')
# http://pwet.fr/man/linux/fichiers_speciaux/hunspell says:
#
# > A dictionary file (*.dic) contains a list of words, one per
@@ -113,49 +129,37 @@ class Hunspell:
# I.e. if '/' is already contained in the input, it cannot
# match a word in the dictionary and we return an empty list
# immediately:
- if '/' in word:
+ if '/' in input_phrase:
return []
# And we should not match further than '/'.
# Take care to use a non-greedy regexp to match only
# one line and not accidentally big chunks of the file!
try:
- regexp = r'^'+re.escape(word)+r'.*?(?=/|$)'
+ regexp = r'^'+re.escape(input_phrase)+r'.*?(?=/|$)'
patt_start = re.compile(regexp,re.MULTILINE|re.UNICODE)
except:
import traceback
traceback.print_exc()
- if self.dict_buffer != None:
- start_words = patt_start.findall(self.dict_buffer)
- if self.pyhunspell_object != None:
- if len(word) >= 4:
- # Always pass NFC to pyhunspell and convert the
- # result back to NFKD, even for Korean (For
- # Korean, hunspell does a NFC -> NFKD conversion
- # of the input and NFKD->NFC conversion of the
- # output)
- word = unicodedata.normalize('NFC', word)
- extra_suggestions = map(
- lambda x: unicodedata.normalize(
- self.normalization_form_internal, x.decode(self.encoding)),
- self.pyhunspell_object.suggest(word.encode(self.encoding, 'replace')))
- for suggestion in extra_suggestions:
- if suggestion not in start_words:
- start_words.append(suggestion)
- else:
- start_words = [u'☹ %(loc)s%(dict_name)s not found.' %{'loc': self.loc, 'dict_name': self.dict_name}, u'☹ please install hunspell dictionary!']
- return list(set(start_words[0:max_words]))
-
- def suggest(self, input_phrase):
- # If the input phrase is very long, don’t try looking
- # something up in the hunspell dictionaries. The regexp match
- # gets very slow if the input phrase is very long. And there
- # are no very long words in the hunspell dictionaries anyway,
- # the longest word in the German hunspell dictionary currently
- # seems to be “Geschwindigkeitsübertretungsverfahren” trying
- # to match words longer than that just wastes time.
- if len(input_phrase) > 40:
- return []
- return self.words_start(input_phrase)
-
-
+ suggested_words = []
+ for dictionary in self.dictionaries:
+ if dictionary.buffer:
+ suggested_words += patt_start.findall(dictionary.buffer)
+ if dictionary.pyhunspell_object:
+ if len(input_phrase) >= 4:
+ # Always pass NFC to pyhunspell and convert the
+ # result back to the internal normalization form (NFD)
+ # (hunspell does the right thing for Korean if the input is NFC).
+ input_phrase = unicodedata.normalize('NFC', input_phrase)
+ extra_suggestions = map(
+ lambda x: unicodedata.normalize(
+ normalization_form_internal, x.decode(dictionary.encoding)),
+ dictionary.pyhunspell_object.suggest(input_phrase.encode(dictionary.encoding, 'replace')))
+ for suggestion in extra_suggestions:
+ if suggestion not in suggested_words:
+ suggested_words.append(suggestion)
+ else:
+ dic_path = os.path.join(dictionary.loc, dictionary.name+'.dic')
+ suggested_words.insert(
+ 0, u'☹ %(dic_path)s not found. Please install hunspell dictionary!' %{'dic_path': dic_path})
+ return suggested_words[0:max_words]
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index d9d6a0c..0aebd74 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -1068,8 +1068,9 @@ class tabengine (IBus.Engine):
self.reset()
return
if name == "dictionaryinstalltimestamp":
- # The dictionary has bin updated or installed, (re)load it:
- print "Reloading dictionary ..."
- self.db.hunspell_obj.load_dictionary()
+ # A dictionary has bin updated or installed,
+ # (re)load all dictionaries:
+ print "Reloading dictionaries ..."
+ self.db.hunspell_obj.load_dictionaries()
self.reset()
return
diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py
index a8bac2f..39b0deb 100755
--- a/ibus-typing-booster/engine/tabsqlitedb.py
+++ b/ibus-typing-booster/engine/tabsqlitedb.py
@@ -90,7 +90,7 @@ class tabsqlitedb:
self._normalization_form_internal = 'NFD'
self.hunspell_obj = hunspell_suggest.Hunspell(
- dict_name=self.ime_properties.get("hunspell_dict").replace('.dic', ''))
+ dictionary_names=[self.ime_properties.get("hunspell_dict").replace('.dic', '')])
user_db = 'user.db'
# user database:
10 years, 5 months
[ibus-typing-booster] master: Add *-inscript2 transliteration options to the Indian languages where these were still missing (1fa1bda)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 1fa1bda8a307df084b7b7368a15e0f06e0e35e65
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Wed Jan 15 15:58:13 2014 +0100
Add *-inscript2 transliteration options to the Indian languages where these were still missing
Resolves: rhbz#1051405 - inscript2 layouts are not supported in ibus-typing-booster
See: https://bugzilla.redhat.com/show_bug.cgi?id=1051405
>---------------------------------------------------------------
ibus-typing-booster/hunspell-tables/as_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/bn_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/gu_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/hi_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/kn_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/ml_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/mr_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/or_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/pa_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/ta_IN.conf | 2 +-
ibus-typing-booster/hunspell-tables/te_IN.conf | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/ibus-typing-booster/hunspell-tables/as_IN.conf b/ibus-typing-booster/hunspell-tables/as_IN.conf
index c420d61..53dda3f 100644
--- a/ibus-typing-booster/hunspell-tables/as_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/as_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = as_IN.dic
hunspell_dict_package = hunspell-as
ime_name = Assamese - IN (Hunspell)
symbol = as-IN
-imes = Inscript:as-inscript,Itrans:as-itrans,Phonetic:as-phonetic
+imes = Enhanced Inscript:as-inscript2,Inscript:as-inscript,Itrans:as-itrans,Phonetic:as-phonetic
setup = /usr/libexec/ibus-setup-typing-booster --config-file as_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/bn_IN.conf b/ibus-typing-booster/hunspell-tables/bn_IN.conf
index 70723df..dfead5d 100644
--- a/ibus-typing-booster/hunspell-tables/bn_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/bn_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = bn_IN.dic
hunspell_dict_package = hunspell-bn
ime_name = Bengali - IN (Hunspell)
symbol = bn-IN
-imes = Inscript:bn-inscript,Probhat:bn-probhat,Itrans:bn-itrans
+imes = Enhanced Inscript:bn-inscript2,Inscript:bn-inscript,Probhat:bn-probhat,Itrans:bn-itrans
setup = /usr/libexec/ibus-setup-typing-booster --config-file bn_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/gu_IN.conf b/ibus-typing-booster/hunspell-tables/gu_IN.conf
index cb32a3c..57d8530 100644
--- a/ibus-typing-booster/hunspell-tables/gu_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/gu_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = gu_IN.dic
hunspell_dict_package = hunspell-gu
ime_name = Gujarati - IN (Hunspell)
symbol = gu-IN
-imes = Inscript:gu-inscript,Phonetic:gu-phonetic,Itrans:gu-itrans
+imes = Enhanced Inscript:gu-inscript2,Inscript:gu-inscript,Phonetic:gu-phonetic,Itrans:gu-itrans
setup = /usr/libexec/ibus-setup-typing-booster --config-file gu_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/hi_IN.conf b/ibus-typing-booster/hunspell-tables/hi_IN.conf
index 749dff1..d23f46c 100644
--- a/ibus-typing-booster/hunspell-tables/hi_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/hi_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = hi_IN.dic
hunspell_dict_package = hunspell-hi
ime_name = Hindi - IN (Hunspell)
symbol = hi-IN
-imes = Inscript:hi-inscript,Phonetic:hi-phonetic,Itrans:hi-itrans,Remington:hi-remington,Typewriter:hi-typewriter,Vedmata:hi-vedmata
+imes = Enhanced Inscript:hi-inscript2,Inscript:hi-inscript,Phonetic:hi-phonetic,Itrans:hi-itrans,Remington:hi-remington,Typewriter:hi-typewriter,Vedmata:hi-vedmata
setup = /usr/libexec/ibus-setup-typing-booster --config-file hi_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/kn_IN.conf b/ibus-typing-booster/hunspell-tables/kn_IN.conf
index 1e08ec1..d786e45 100644
--- a/ibus-typing-booster/hunspell-tables/kn_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/kn_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = kn_IN.dic
hunspell_dict_package = hunspell-kn
ime_name = Kannada - IN (Hunspell)
symbol = kn-IN
-imes = Inscript:kn-inscript,Itrans:kn-itrans,Kgp:kn-kgp,Typewriter:kn-typewriter
+imes = Enhanced Inscript:kn-inscript2,Inscript:kn-inscript,Itrans:kn-itrans,Kgp:kn-kgp,Typewriter:kn-typewriter
setup = /usr/libexec/ibus-setup-typing-booster --config-file kn_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/ml_IN.conf b/ibus-typing-booster/hunspell-tables/ml_IN.conf
index ca036e4..fd4af0f 100644
--- a/ibus-typing-booster/hunspell-tables/ml_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/ml_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = ml_IN.dic
hunspell_dict_package = hunspell-ml
ime_name = Malayalam - IN (Hunspell)
symbol = ml-IN
-imes = Inscript:ml-inscript,Mozhi:ml-mozhi,Itrans:ml-itrans,Swanalekha:ml-swanalekha
+imes = Enhanced Inscript:ml-inscript2,Inscript:ml-inscript,Mozhi:ml-mozhi,Itrans:ml-itrans,Swanalekha:ml-swanalekha
setup = /usr/libexec/ibus-setup-typing-booster --config-file ml_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/mr_IN.conf b/ibus-typing-booster/hunspell-tables/mr_IN.conf
index 813136a..9f644dd 100644
--- a/ibus-typing-booster/hunspell-tables/mr_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/mr_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = mr_IN.dic
hunspell_dict_package = hunspell-mr
ime_name = Marathi - IN (Hunspell)
symbol = mr-IN
-imes = Inscript:mr-inscript,Phonetic:mr-phonetic,Itrans:mr-itrans
+imes = Enhanced Inscript:mr-inscript2,Inscript:mr-inscript,Phonetic:mr-phonetic,Itrans:mr-itrans
setup = /usr/libexec/ibus-setup-typing-booster --config-file mr_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/or_IN.conf b/ibus-typing-booster/hunspell-tables/or_IN.conf
index b4e2506..bc0511a 100644
--- a/ibus-typing-booster/hunspell-tables/or_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/or_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = or_IN.dic
hunspell_dict_package = hunspell-or
ime_name = Odiya - IN (Hunspell)
symbol = or-IN
-imes = Inscript:or-inscript,Phonetic:or-phonetic,Itrans:or-itrans
+imes = Enhanced Inscript:or-inscript2,Inscript:or-inscript,Phonetic:or-phonetic,Itrans:or-itrans
setup = /usr/libexec/ibus-setup-typing-booster --config-file or_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/pa_IN.conf b/ibus-typing-booster/hunspell-tables/pa_IN.conf
index e267c77..fe9dfbf 100644
--- a/ibus-typing-booster/hunspell-tables/pa_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/pa_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = pa_IN.dic
hunspell_dict_package = hunspell-pa
ime_name = Punjabi - IN (Hunspell)
symbol = pa-IN
-imes = Inscript:pa-inscript,Phonetic:pa-phonetic,Itrans:pa-itrans,Jhelum:pa-jhelum
+imes = Enhanced Inscript:pa-inscript2,Inscript:pa-inscript,Phonetic:pa-phonetic,Itrans:pa-itrans,Jhelum:pa-jhelum
setup = /usr/libexec/ibus-setup-typing-booster --config-file pa_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/ta_IN.conf b/ibus-typing-booster/hunspell-tables/ta_IN.conf
index 327a39f..9362dfb 100644
--- a/ibus-typing-booster/hunspell-tables/ta_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/ta_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = ta_IN.dic
hunspell_dict_package = hunspell-ta
ime_name = Tamil - IN (Hunspell)
symbol = ta-IN
-imes = Inscript:ta-inscript,Phonetic:ta-phonetic,Itrans:ta-itrans,Typewriter:ta-typewriter
+imes = Enhanced Inscript:ta-inscript2,Inscript:ta-inscript,Phonetic:ta-phonetic,Itrans:ta-itrans,Typewriter:ta-typewriter
setup = /usr/libexec/ibus-setup-typing-booster --config-file ta_IN.conf
diff --git a/ibus-typing-booster/hunspell-tables/te_IN.conf b/ibus-typing-booster/hunspell-tables/te_IN.conf
index 7488d6e..3847d40 100644
--- a/ibus-typing-booster/hunspell-tables/te_IN.conf
+++ b/ibus-typing-booster/hunspell-tables/te_IN.conf
@@ -11,5 +11,5 @@ hunspell_dict = te_IN.dic
hunspell_dict_package = hunspell-te
ime_name = Telugu - IN (Hunspell)
symbol = te-IN
-imes = Inscript:te-inscript,Itrans:te-itrans,Apple:te-apple,Pothana:te-pothana,Rts:te-rts
+imes = Enhanced Inscript:te-inscript2,Inscript:te-inscript,Itrans:te-itrans,Apple:te-apple,Pothana:te-pothana,Rts:te-rts
setup = /usr/libexec/ibus-setup-typing-booster --config-file te_IN.conf
10 years, 5 months
[ibus-typing-booster] master: Use a single user database for all engines (9392219)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 9392219d79b951b3243a8455b928e581cc8f72c4
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Fri Sep 27 16:51:21 2013 +0200
Use a single user database for all engines
To make ibus-typing-booster more multilingual, it is useful to add
trigrams always to the same user database for all languages. For
example, when trigrams are added to the user database while typing
English, they do not really hurt when typing German later. If the
previous two words are German, English trigrams will just not
match. But this makes it possible to switch automatically to typing
English while staying with the German engine. Just typing a few
English words while still using the German engines makes the English
trigrams match again. So this gives automatic language switching for
the user trigrams for all engines using Latin script.
>---------------------------------------------------------------
ibus-typing-booster/engine/tabsqlitedb.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py
index 2f55a66..a8bac2f 100755
--- a/ibus-typing-booster/engine/tabsqlitedb.py
+++ b/ibus-typing-booster/engine/tabsqlitedb.py
@@ -92,7 +92,7 @@ class tabsqlitedb:
self.hunspell_obj = hunspell_suggest.Hunspell(
dict_name=self.ime_properties.get("hunspell_dict").replace('.dic', ''))
- user_db = self.ime_properties.get("name")+'-user.db'
+ user_db = 'user.db'
# user database:
if user_db != None:
home_path = os.getenv ("HOME")
10 years, 5 months
[ibus-typing-booster] master: Add timestamp support to user_transliteration.py (7401a2b)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 7401a2b685c275b1dbef7e2a52d1e3fd13e8af1d
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Mon Jan 13 17:30:20 2014 +0100
Add timestamp support to user_transliteration.py
Use user_freq = 0 for all these entries transliterated from a hunspell
dictionary to give them the same initial priority as words from the
original hunspell dictionaries.
>---------------------------------------------------------------
ibus-typing-booster/setup/user_transliteration.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/ibus-typing-booster/setup/user_transliteration.py b/ibus-typing-booster/setup/user_transliteration.py
index 6a4829a..03eef03 100644
--- a/ibus-typing-booster/setup/user_transliteration.py
+++ b/ibus-typing-booster/setup/user_transliteration.py
@@ -22,6 +22,7 @@ import sys
import re
import codecs
import sqlite3
+import time
from gi.repository import Translit
@@ -160,10 +161,13 @@ class LatinConvert:
sql_table_name = "phrases"
try:
conn = sqlite3.connect(self.user_db)
- sql = "INSERT INTO %s (input_phrase, phrase) values(:input_phrase, :phrase);" % (sql_table_name)
+ sql = "INSERT INTO %s (input_phrase, phrase, user_freq, timestamp) values(:input_phrase, :phrase, :user_freq, :timestamp);" % (sql_table_name)
sqlargs = []
map(lambda x: sqlargs.append(
- {'input_phrase': x.decode('utf-8'), 'phrase': x.decode('utf-8')}),
+ {'input_phrase': x.decode('utf-8'),
+ 'phrase': x.decode('utf-8'),
+ 'user_freq': 0,
+ 'timestamp': time.time()}),
words)
conn.executemany(sql,sqlargs)
conn.commit()
10 years, 5 months
[ibus-typing-booster] master: Add timestamps to entries in the user database (cb8c7c2)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit cb8c7c2703e1224ad22be629b196b23860745bf5
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Thu Jun 27 17:42:43 2013 +0200
Add timestamps to entries in the user database
Using time.time() which returns the time in seconds since the epoch as
a floating point number.
This is to make it possible to clean out entries which are old
and not used if the database becomes too large and to be able to
calculate some statistics.
>---------------------------------------------------------------
ibus-typing-booster/engine/tabsqlitedb.py | 50 +++++++++++++++++------------
1 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py
index 247c87a..2f55a66 100755
--- a/ibus-typing-booster/engine/tabsqlitedb.py
+++ b/ibus-typing-booster/engine/tabsqlitedb.py
@@ -29,7 +29,7 @@ import re
import itb_util
import hunspell_suggest
-user_database_version = '0.64'
+user_database_version = '0.65'
class ImeProperties:
def __init__(self, configfile_path=None):
@@ -61,7 +61,7 @@ class tabsqlitedb:
The phrases table in the database has columns with the names:
- “id”, “input_phrase”, “phrase”, “p_phrase”, “pp_phrase”, “user_freq”
+ “id”, “input_phrase”, “phrase”, “p_phrase”, “pp_phrase”, “user_freq”, “timestamp”
There are 2 databases, sysdb, userdb.
@@ -79,7 +79,7 @@ class tabsqlitedb:
user_freq >= 1: The number of times the user has used this phrase
'''
def __init__(self, config_filename=None):
- self._phrase_table_column_names = ['id', 'input_phrase', 'phrase', 'p_phrase', 'pp_phrase', 'user_freq']
+ self._phrase_table_column_names = ['id', 'input_phrase', 'phrase', 'p_phrase', 'pp_phrase', 'user_freq', 'timestamp']
self.old_phrases=[]
@@ -184,11 +184,11 @@ class tabsqlitedb:
if self.old_phrases:
sqlargs = []
map(lambda x: sqlargs.append(
- {'input_phrase': x[0], 'phrase': x[0], 'p_phrase': u'', 'pp_phrase': u'', 'user_freq': x[1]}),
+ {'input_phrase': x[0], 'phrase': x[0], 'p_phrase': u'', 'pp_phrase': u'', 'user_freq': x[1], 'timestamp': time.time()}),
self.old_phrases)
sqlstr = '''
- INSERT INTO user_db.phrases (input_phrase, phrase, p_phrase, pp_phrase, user_freq)
- VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq)
+ INSERT INTO user_db.phrases (input_phrase, phrase, p_phrase, pp_phrase, user_freq, timestamp)
+ VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq, :timestamp)
;'''
try:
self.db.executemany(sqlstr, sqlargs)
@@ -232,16 +232,21 @@ class tabsqlitedb:
self._normalization_form_internal, pp_phrase)
sqlstr = '''
UPDATE %(database)s.phrases
- SET user_freq = :user_freq
+ SET user_freq = :user_freq, timestamp = :timestamp
WHERE input_phrase = :input_phrase
AND phrase = :phrase AND p_phrase = :p_phrase AND pp_phrase = :pp_phrase
;''' %{'database':database}
sqlargs = {'user_freq': user_freq,
'input_phrase': input_phrase,
- 'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase}
- self.db.execute(sqlstr, sqlargs)
- if commit:
- self.db.commit()
+ 'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase,
+ 'timestamp': time.time()}
+ try:
+ self.db.execute(sqlstr, sqlargs)
+ if commit:
+ self.db.commit()
+ except:
+ import traceback
+ traceback.print_exc()
def sync_usrdb (self):
'''
@@ -255,7 +260,7 @@ class tabsqlitedb:
sqlstr = '''CREATE TABLE IF NOT EXISTS %s.phrases
(id INTEGER PRIMARY KEY,
input_phrase TEXT, phrase TEXT, p_phrase TEXT, pp_phrase TEXT,
- user_freq INTEGER);''' % database
+ user_freq INTEGER, timestamp REAL);''' % database
self.db.execute(sqlstr)
self.db.commit()
@@ -287,12 +292,12 @@ class tabsqlitedb:
insert_sqlstr = '''
INSERT INTO %(database)s.phrases
- (input_phrase, phrase, p_phrase, pp_phrase, user_freq)
- VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq)
+ (input_phrase, phrase, p_phrase, pp_phrase, user_freq, timestamp)
+ VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq, :timestamp)
;''' %{'database': database}
insert_sqlargs = {'input_phrase': input_phrase,
'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase,
- 'user_freq': user_freq}
+ 'user_freq': user_freq, 'timestamp': time.time()}
try:
self.db.execute (insert_sqlstr, insert_sqlargs)
if commit:
@@ -533,7 +538,7 @@ class tabsqlitedb:
Determines the number of columns by parsing this:
sqlite> select sql from sqlite_master where name='phrases';
-CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_phrase TEXT, pp_phrase TEXT, user_freq INTEGER)
+CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_phrase TEXT, pp_phrase TEXT, user_freq INTEGER, timestamp REAL)
sqlite>
This result could be on a single line, as above, or on multiple
@@ -665,7 +670,7 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_
def read_training_data_from_file(self, filename):
if not os.path.isfile(filename):
return False
- rows = self.db.execute('SELECT input_phrase, phrase, p_phrase, pp_phrase, user_freq FROM phrases;').fetchall()
+ rows = self.db.execute('SELECT input_phrase, phrase, p_phrase, pp_phrase, user_freq, timestamp FROM phrases;').fetchall()
p_token = u''
pp_token = u''
database_dict = {}
@@ -675,7 +680,8 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_
'phrase': x[1],
'p_phrase': x[2],
'pp_phrase': x[3],
- 'user_freq': x[4]}
+ 'user_freq': x[4],
+ 'timestamp': x[5]}
)]), rows)
with codecs.open(filename, encoding='UTF-8') as file:
lines = map(lambda x: unicodedata.normalize(self._normalization_form_internal, x), file.readlines())
@@ -684,19 +690,21 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_
key = (token, token, p_token, pp_token)
if key in database_dict:
database_dict[key]['user_freq'] += 1
+ database_dict[key]['timestamp'] = time.time()
else:
database_dict[key] = {'input_phrase': token,
'phrase': token,
'p_phrase': p_token,
'pp_phrase': pp_token,
- 'user_freq': 1}
+ 'user_freq': 1,
+ 'timestamp': time.time()}
pp_token = p_token
p_token = token
sqlargs = []
map(lambda x: sqlargs.append(database_dict[x]), database_dict.keys())
sqlstr = '''
- INSERT INTO user_db.phrases (input_phrase, phrase, p_phrase, pp_phrase, user_freq)
- VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq)
+ INSERT INTO user_db.phrases (input_phrase, phrase, p_phrase, pp_phrase, user_freq, timestamp)
+ VALUES (:input_phrase, :phrase, :p_phrase, :pp_phrase, :user_freq, :timestamp)
;'''
try:
self.db.execute('DELETE FROM phrases;')
10 years, 5 months
[ibus-typing-booster] master: Fix behaviour of arrow right keys in pre��dit (99dc05a)
by mfabian@fedoraproject.org
Repository : http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master
>---------------------------------------------------------------
commit 99dc05abae00f0425ac65651d96281e28dd42e1a
Author: Mike FABIAN <mfabian(a)redhat.com>
Date: Tue Jan 7 12:58:15 2014 +0100
Fix behaviour of arrow right keys in preëdit
Resolves: rhbz#1049324 - Using the arrow right key in preëdit does work correctly, it moves the preëdit to the right
See: https://bugzilla.redhat.com/show_bug.cgi?id=1049324
>---------------------------------------------------------------
ibus-typing-booster/engine/hunspell_table.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py
index d02fc36..d9d6a0c 100644
--- a/ibus-typing-booster/engine/hunspell_table.py
+++ b/ibus-typing-booster/engine/hunspell_table.py
@@ -853,9 +853,9 @@ class tabengine (IBus.Engine):
if key.code in (IBus.KEY_Right, IBus.KEY_KP_Right):
if self._editor.is_empty():
return False
- res = self._editor.arrow_right ()
+ self._editor.arrow_right ()
self._update_ui ()
- return res
+ return True
if key.code == IBus.KEY_BackSpace and key.mask & IBus.ModifierType.CONTROL_MASK:
if self._editor.is_empty():
10 years, 5 months