Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
List overview
Download
ibus-typing-booster
August 2015
----- 2024 -----
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
ibus-typing-booster@lists.fedorahosted.org
1 participants
8 discussions
Start a n
N
ew thread
[ibus-typing-booster] miketmp-debug: WIP: usage experiment: de_DE & en_GB dictionary (25c9d8e)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : miketmp-debug >--------------------------------------------------------------- commit 25c9d8eb7b66bf204526611f8bade9d9581eaea9 Author: Mike FABIAN <mfabian(a)redhat.com> Date: Fri Jan 17 14:52:04 2014 +0100 WIP: usage experiment: de_DE & en_GB dictionary >--------------------------------------------------------------- ibus-typing-booster/hunspell-tables/de_DE.conf | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ibus-typing-booster/hunspell-tables/de_DE.conf b/ibus-typing-booster/hunspell-tables/de_DE.conf index 0f8251d..b7adbb2 100644 --- a/ibus-typing-booster/hunspell-tables/de_DE.conf +++ b/ibus-typing-booster/hunspell-tables/de_DE.conf @@ -7,7 +7,7 @@ language = de author = Mike FABIAN <mfabian(a)redhat.com> status_prompt = de layout = default -hunspell_dict = de_DE.dic +hunspell_dict = de_DE.dic, en_GB.dic hunspell_dict_package = hunspell-de ime_name = German - DE (Hunspell) symbol = de-DE
1
0
0
0
[ibus-typing-booster] miketmp-debug: add sys.stderr.write("mike ..." debug messages) (3809209)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : miketmp-debug >--------------------------------------------------------------- commit 3809209ec38caab577bfdea07027bd23a55aab7e Author: Mike FABIAN <mfabian(a)redhat.com> Date: Wed Jun 12 15:55:07 2013 +0200 add sys.stderr.write("mike ..." debug messages) >--------------------------------------------------------------- ibus-typing-booster/engine/factory.py | 1 + ibus-typing-booster/engine/hunspell_suggest.py | 2 ++ ibus-typing-booster/engine/hunspell_table.py | 18 ++++++++++++++++++ ibus-typing-booster/engine/tabsqlitedb.py | 19 +++++++++++++++++++ 4 files changed, 40 insertions(+), 0 deletions(-) diff --git a/ibus-typing-booster/engine/factory.py b/ibus-typing-booster/engine/factory.py index 84e64d6..3b61ebf 100755 --- a/ibus-typing-booster/engine/factory.py +++ b/ibus-typing-booster/engine/factory.py @@ -23,6 +23,7 @@ import hunspell_table import tabsqlitedb import os import re +import sys from gettext import dgettext _ = lambda a : dgettext ("ibus-typing-booster", a) diff --git a/ibus-typing-booster/engine/hunspell_suggest.py b/ibus-typing-booster/engine/hunspell_suggest.py index d373277..6974093 100755 --- a/ibus-typing-booster/engine/hunspell_suggest.py +++ b/ibus-typing-booster/engine/hunspell_suggest.py @@ -109,6 +109,7 @@ class Hunspell: self.load_dictionaries() def load_dictionaries(self): + print("mike dictionary_names=%s\n" %self.dictionary_names) for dictionary_name in self.dictionary_names: self.dictionaries.append(Dictionary(name=dictionary_name)) @@ -124,6 +125,7 @@ class Hunspell: return [] if type(input_phrase) != type(u''): input_phrase = input_phrase.decode('utf8') + sys.stderr.write("mike in suggest input_phrase=%(ip)s\n" %{'ip': input_phrase.encode('UTF-8')}) #
http://pwet.fr/man/linux/fichiers_speciaux/hunspell
says: # # > A dictionary file (*.dic) contains a list of words, one per diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py index b613196..14e2ff6 100644 --- a/ibus-typing-booster/engine/hunspell_table.py +++ b/ibus-typing-booster/engine/hunspell_table.py @@ -85,6 +85,7 @@ class editor(object): '''Hold user inputs chars and preedit string''' def __init__ (self, config, database): + sys.stderr.write("mike editor __init__\n") self.db = database self._config = config self._name = self.db.ime_properties.get('name') @@ -141,6 +142,7 @@ class editor(object): self.trans_m17n_mode = True try: #self.trans = Translit.Transliterator.get(self._m17ndb, self._current_ime) + sys.stderr.write("mike calling Transliterator.get(%(m17n)s, %(cur)s)\n" %{'m17n': self._m17ndb, 'cur': self._current_ime}) self.trans = Transliterator.get(self._m17ndb, self._current_ime) except: import traceback @@ -170,12 +172,19 @@ class editor(object): 'NFKD', self._transliterated_string) else: self._transliterated_string = self._typed_string + sys.stderr.write("mike in update_transliterated_string() self._typed_string=%s\n" %self._typed_string.encode('UTF-8')) + sys.stderr.write("mike in update_transliterated_string() repr(self._typed_string)=%s\n" %repr(self._typed_string)) + sys.stderr.write("mike in update_transliterated_string() self._transliterated_string=%s\n" %self._transliterated_string.encode('UTF-8')) + sys.stderr.write("mike in update_transliterated_string() repr(self._transliterated_string)=%s\n" %repr(self._transliterated_string)) def get_transliterated_string(self): return self._transliterated_string def insert_string_at_cursor(self, string_to_insert): '''Insert typed string at cursor position''' + sys.stderr.write("mike in insert_string_at_cursor() string_to_insert=%s\n" %string_to_insert.encode('UTF-8')) + sys.stderr.write("mike in insert_string_at_cursor() self._typed_string=%s\n" %self._typed_string.encode('UTF-8')) + sys.stderr.write("mike in insert_string_at_cursor() self._typed_string_cursor=%s\n" %self._typed_string_cursor) self._typed_string = self._typed_string[:self._typed_string_cursor] \ +string_to_insert \ +self._typed_string[self._typed_string_cursor:] @@ -320,6 +329,7 @@ class editor(object): def update_candidates (self): '''Update lookuptable''' + sys.stderr.write("mike in update_candidates() self._typed_string=%s\n" %self._typed_string.encode('UTF-8')) if self._typed_string == self._typed_string_when_update_candidates_was_last_called: # The input did not change since we came here last, do nothing and leave # candidates and lookup table unchanged: @@ -488,6 +498,7 @@ class tabengine (IBus.Engine): '''The IM Engine for Tables''' def __init__ (self, bus, obj_path, db ): + sys.stderr.write("mike in tabengine __init__() obj_path=%s\n" %obj_path) super(tabengine,self).__init__ (connection=bus.get_connection(),object_path=obj_path) global debug_level try: @@ -551,6 +562,7 @@ class tabengine (IBus.Engine): def _change_mode (self): '''Shift input mode, TAB -> EN -> TAB ''' + sys.stderr.write("mike in hunspell_table.py _change_mode()\n") self.reset () self._update_ui () @@ -718,7 +730,10 @@ class tabengine (IBus.Engine): if self._has_input_purpose and self._input_purpose in [IBus.InputPurpose.PASSWORD, IBus.InputPurpose.PIN]: return False + sys.stderr.write("mike in process_key_event keyval=%(kv)s keycode=%(kc)s state=%(st)s\n" %{'kv': keyval, 'kc': keycode, 'st': state}) key = KeyEvent(keyval, keycode, state) + sys.stderr.write("mike after KeyEvent() in process_key_event key.val=%(kval)s\n" %{'kval': key.val}) + sys.stderr.write("mike after KeyEvent() in process_key_event key.val=%(kval)s IBus.keyval_to_unicode(key.val)=%(uc)s\n" %{'kval': key.val, 'uc': IBus.keyval_to_unicode(key.code)}) # ignore NumLock mask key.state &= ~IBus.ModifierType.MOD2_MASK @@ -739,6 +754,9 @@ class tabengine (IBus.Engine): return True if self._editor.is_empty (): + sys.stderr.write("mike self._editor.is_empty ():\n") + sys.stderr.write("mike key.val=%(key.val)s IBus.keyval_to_unicode(key.val)=%(keychar)s\n" %{'key.val': key.val, 'keychar': IBus.keyval_to_unicode(key.val)}) + sys.stderr.write("mike IBus.keyval_name(key.val)=%s\n" %IBus.keyval_name(key.val)) # This is the first character typed since the last commit # there is nothing in the preëdit yet. if key.val < 32: diff --git a/ibus-typing-booster/engine/tabsqlitedb.py b/ibus-typing-booster/engine/tabsqlitedb.py index 78a4b26..2815503 100755 --- a/ibus-typing-booster/engine/tabsqlitedb.py +++ b/ibus-typing-booster/engine/tabsqlitedb.py @@ -241,6 +241,8 @@ class tabsqlitedb: 'input_phrase': input_phrase, 'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase, 'timestamp': time.time()} + sys.stderr.write("mike update_phrase() sqlstr=%s\n" %sqlstr) + sys.stderr.write("mike update_phrase() sqlargs=%s\n" %sqlargs) try: self.db.execute(sqlstr, sqlargs) if commit: @@ -253,8 +255,10 @@ class tabsqlitedb: ''' Trigger a checkpoint operation. ''' + sys.stderr.write("mike sync_userdb() commit and execute checkpoint ...\n") self.db.commit() self.db.execute('PRAGMA wal_checkpoint;') + sys.stderr.write("mike sync_userdb() commit and execute checkpoint done.\n") def create_tables (self, database): '''Create table for the phrases.''' @@ -269,6 +273,7 @@ class tabsqlitedb: ''' Add phrase to database ''' + sys.stderr.write("mike in add_phrase() input_phrase=%(ip)s phrase=%(p)s user_freq=%(uf)s database=%(db)s\n" %{'ip': input_phrase.encode('UTF-8'), 'p': phrase.encode('UTF-8'), 'uf': user_freq, 'db': database}) if not input_phrase or not phrase: return input_phrase = unicodedata.normalize( @@ -299,6 +304,8 @@ class tabsqlitedb: insert_sqlargs = {'input_phrase': input_phrase, 'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase, 'user_freq': user_freq, 'timestamp': time.time()} + sys.stderr.write("mike add_phrase() insert_sqlstr=%s\n" %insert_sqlstr) + sys.stderr.write("mike add_phrase() insert_sqlargs=%s\n" %insert_sqlargs) try: self.db.execute (insert_sqlstr, insert_sqlargs) if commit: @@ -368,9 +375,11 @@ class tabsqlitedb: self._normalization_form_internal, p_phrase) pp_phrase = unicodedata.normalize( self._normalization_form_internal, pp_phrase) + sys.stderr.write("mike in select_words() input_phrase=%(ip)s p_phrase=%(p)s pp_phrase=%(pp)s\n" %{'ip': input_phrase.encode('UTF-8'), 'p': p_phrase.encode('UTF-8'), 'pp': pp_phrase.encode('UTF-8')}) phrase_frequencies = {} for x in self.hunspell_obj.suggest(input_phrase): phrase_frequencies.update([(x, 0)]) + sys.stderr.write("mike in select_words() hunspell: best_candidates=%s\n" %self.best_candidates(phrase_frequencies)) # Now phrase_frequencies might contain something like this: # # {u'code': 0, u'communicability': 0, u'cold': 0, u'colour': 0} @@ -437,6 +446,7 @@ class tabsqlitedb: # {u'conspiracy': 6/11, u'code': 0, u'communicability': 0, u'cold': 1/11, u'colour': 4/11} for x in results_uni: phrase_frequencies.update([(x[0], x[1]/float(count))]) + sys.stderr.write("mike in select_words() Unigram best_candidates=%s\n" %self.best_candidates(phrase_frequencies)) if not p_phrase: # If no context for bigram matching is available, return what we have so far: return self.best_candidates(phrase_frequencies) @@ -461,6 +471,7 @@ class tabsqlitedb: # both the weight of 0.5: for x in results_bi: phrase_frequencies.update([(x[0], 0.5*x[1]/float(count_p_phrase)+0.5*phrase_frequencies[x[0]])]) + sys.stderr.write("mike in select_words() Bigram best_candidates=%s\n" %self.best_candidates(phrase_frequencies)) if not pp_phrase: # If no context for trigram matching is available, return what we have so far: return self.best_candidates(phrase_frequencies) @@ -487,6 +498,7 @@ class tabsqlitedb: # get higher weight): for x in results_tri: phrase_frequencies.update([(x[0], 0.5*x[1]/float(count_pp_phrase_p_phrase)+0.5*phrase_frequencies[x[0]])]) + sys.stderr.write("mike in select_words() Trigram best_candidates=%s\n" %self.best_candidates(phrase_frequencies)) return self.best_candidates(phrase_frequencies) def generate_userdb_desc (self): @@ -592,6 +604,8 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_ input_phrase = unicodedata.normalize( self._normalization_form_internal, input_phrase) + sys.stderr.write("mike check_phrase() phrase=%(p)s, input_phrase=%(t)s, database=%(d)s\n" %{'p': phrase.encode('UTF-8'), 't': input_phrase.encode('UTF-8'), 'd': database}) + # There should never be more than 1 database row for the same # input_phrase *and* phrase. So the following query on # the database should match at most one database @@ -608,7 +622,10 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_ ;''' sqlargs = {'input_phrase': input_phrase, 'phrase': phrase, 'p_phrase': p_phrase, 'pp_phrase': pp_phrase} + sys.stderr.write("mike sqlstr=%s\n" %sqlstr) + sys.stderr.write("mike sqlargs=%s\n" %sqlargs) result = self.db.execute(sqlstr, sqlargs).fetchall() + sys.stderr.write("mike result=%s\n" %result) if len(result) > 0: # A match was found in user_db, increase user frequency by 1 self.update_phrase(input_phrase = input_phrase, @@ -630,6 +647,8 @@ CREATE TABLE phrases (id INTEGER PRIMARY KEY, input_phrase TEXT, phrase TEXT, p_ Or, if “input_phrase” is “None”, remove all rows matching “phrase” no matter for what input phrase from the database. ''' + sys.stderr.write("mike remove_phrase() phrase=%(p)s\n" %{'p': phrase.encode('UTF-8')}) + sys.stderr.write("mike remove_phrase() database=%s\n" %database) if not phrase: return phrase = unicodedata.normalize(
1
0
0
0
[ibus-typing-booster] miketmp-debug: MOD5 experiment (a9555c8)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : miketmp-debug >--------------------------------------------------------------- commit a9555c816fd285b51a9d79123a64a23c9c88ca1b Author: Mike FABIAN <mfabian(a)redhat.com> Date: Thu Feb 20 08:17:03 2014 +0100 MOD5 experiment >--------------------------------------------------------------- ibus-typing-booster/engine/hunspell_table.py | 3 ++- ibus-typing-booster/hunspell-tables/mr_IN.conf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ibus-typing-booster/engine/hunspell_table.py b/ibus-typing-booster/engine/hunspell_table.py index 14e2ff6..99974a1 100644 --- a/ibus-typing-booster/engine/hunspell_table.py +++ b/ibus-typing-booster/engine/hunspell_table.py @@ -805,7 +805,7 @@ class tabengine (IBus.Engine): self._editor.insert_string_at_cursor(token) self._update_ui() return True - if key.val >= 32 and (not (key.state & (IBus.ModifierType.MOD1_MASK | IBus.ModifierType.CONTROL_MASK))): + if key.val >= 32 and (not (key.state & (IBus.ModifierType.MOD1_MASK | IBus.ModifierType.CONTROL_MASK | IBus.ModifierType.MOD5_MASK))): typed_character = IBus.keyval_to_unicode(key.val) if type(typed_character) != type(u''): typed_character = typed_character.decode('UTF-8') @@ -1023,6 +1023,7 @@ class tabengine (IBus.Engine): typed_character = IBus.keyval_to_unicode(key.val) if type(typed_character) != type(u''): typed_character = typed_character.decode('UTF-8') + sys.stderr.write("mike: MOD5_MASK=%(bit)s\n" %{'bit': key.state & IBus.ModifierType.MOD5_MASK}) self._editor.insert_string_at_cursor(typed_character) if typed_character and unicodedata.category(typed_character) in itb_util.categories_to_trigger_immediate_commit: input_phrase = self._editor.get_transliterated_string() diff --git a/ibus-typing-booster/hunspell-tables/mr_IN.conf b/ibus-typing-booster/hunspell-tables/mr_IN.conf index 9f644dd..3c2b675 100644 --- a/ibus-typing-booster/hunspell-tables/mr_IN.conf +++ b/ibus-typing-booster/hunspell-tables/mr_IN.conf @@ -6,7 +6,7 @@ description = This is a Marathi typing booster engine table for Marathi language language = mr author = Anish Patil <apatil(a)redhat.com> status_prompt = mr -layout = default +layout = default[lv3:ralt_switch] hunspell_dict = mr_IN.dic hunspell_dict_package = hunspell-mr ime_name = Marathi - IN (Hunspell)
1
0
0
0
[ibus-typing-booster] branch 'miketmp-debug' created
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
New branch : miketmp-debug Referencing: a9555c816fd285b51a9d79123a64a23c9c88ca1b
1
0
0
0
[ibus-typing-booster] branch 'miketmp-debug' deleted
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
Deleted branch: miketmp-debug
1
0
0
0
[ibus-typing-booster] master: Release 1.2.12 (473c1ab)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master >--------------------------------------------------------------- commit 473c1ab82feed861e78f178f9a3c4b39a42dc99f Author: Mike FABIAN <mfabian(a)redhat.com> Date: Thu Aug 27 09:35:10 2015 +0200 Release 1.2.12 >--------------------------------------------------------------- ibus-typing-booster/ChangeLog | 4 ++++ ibus-typing-booster/configure.ac | 2 +- ibus-typing-booster/ibus-typing-booster.pc.in | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ibus-typing-booster/ChangeLog b/ibus-typing-booster/ChangeLog index 929a704..f63338c 100644 --- a/ibus-typing-booster/ChangeLog +++ b/ibus-typing-booster/ChangeLog @@ -1,4 +1,8 @@ * Author: Mike FABIAN <mfabian(a)redhat.com> +* 27 Aug 2015 Released 1.2.12 version +* Use open() instead of codecs.open() to fix dictionary loading problem on F23 (Resolves: rhbz#1257465) + +* Author: Mike FABIAN <mfabian(a)redhat.com> * 24 Sep 2014 Released 1.2.11 version * Require Python >= 3.3 * Always write xml output in UTF-8 encoding, not in the encoding of the current locale diff --git a/ibus-typing-booster/configure.ac b/ibus-typing-booster/configure.ac index 4d77224..1879fe1 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], [11]) +m4_define([ibus_micro_version], [12]) 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 5e341de..270a3db 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.11 +Version: 1.2.12 Requires: Libs: Cflags:
1
0
0
0
[ibus-typing-booster] master: Use open() instead of codecs.open() to fix dictionary loading problem on F23 (a93fe54)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master >--------------------------------------------------------------- commit a93fe5423509c8f268cc958958d02827babfd429 Author: Mike FABIAN <mfabian(a)redhat.com> Date: Thu Aug 27 09:17:32 2015 +0200 Use open() instead of codecs.open() to fix dictionary loading problem on F23 Resolves: rhbz#1257465 - Loading hunspell dictionaries fails in ibus-typing-booster
https://bugzilla.redhat.com/show_bug.cgi?id=1257465
>--------------------------------------------------------------- ibus-typing-booster/engine/hunspell_suggest.py | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ibus-typing-booster/engine/hunspell_suggest.py b/ibus-typing-booster/engine/hunspell_suggest.py index 299b01c..d373277 100755 --- a/ibus-typing-booster/engine/hunspell_suggest.py +++ b/ibus-typing-booster/engine/hunspell_suggest.py @@ -21,7 +21,6 @@ import os import sys import unicodedata import re -import codecs import_enchant_successful = False import_hunspell_successful = False @@ -65,7 +64,7 @@ class Dictionary: %{'n': self.name, 'd': dic_path, 'a': aff_path}) return try: - aff_buffer = codecs.open(aff_path, mode='r', encoding='ISO-8859-1', errors='ignore').read().replace('\r\n', '\n') + aff_buffer = open(aff_path, mode='r', encoding='ISO-8859-1', errors='ignore').read().replace('\r\n', '\n') except: import traceback traceback.print_exc() @@ -79,15 +78,15 @@ class Dictionary: print("load_dictionary(): encoding=%(enc)s found in %(aff)s" %{ 'enc': self.encoding, 'aff': aff_path}) try: - self.buffer = codecs.open( - dic_path).read().decode(self.encoding).replace('\r\n', '\n') + self.buffer = open( + dic_path, encoding=self.encoding).read().replace('\r\n', '\n') except: print("load_dictionary(): loading %(dic)s as %(enc)s encoding failed, fall back to ISO-8859-1." %{ 'dic': dic_path, 'enc': self.encoding}) self.encoding = 'ISO-8859-1' try: - self.buffer = codecs.open( - dic_path).read().decode(self.encoding).replace('\r\n', '\n') + self.buffer = open( + dic_path, encoding=self.encoding).read().replace('\r\n', '\n') except: print("load_dictionary(): loading %(dic)s as %(enc)s encoding failed, giving up." %{ 'dic': dic_path, 'enc': self.encoding})
1
0
0
0
[ibus-typing-booster] master: Fix some pylint warnings (a65c771)
by mfabian@fedoraproject.org
27 Aug '15
27 Aug '15
Repository :
http://git.fedorahosted.org/git/?p=ibus-typing-booster.git
On branch : master >--------------------------------------------------------------- commit a65c771a80198291c15e6073280fa4d49b58ef22 Author: Mike FABIAN <mfabian(a)redhat.com> Date: Thu Aug 27 09:15:18 2015 +0200 Fix some pylint warnings >--------------------------------------------------------------- ibus-typing-booster/engine/hunspell_suggest.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ibus-typing-booster/engine/hunspell_suggest.py b/ibus-typing-booster/engine/hunspell_suggest.py index d04895d..299b01c 100755 --- a/ibus-typing-booster/engine/hunspell_suggest.py +++ b/ibus-typing-booster/engine/hunspell_suggest.py @@ -106,10 +106,10 @@ class Dictionary: class Hunspell: def __init__(self, dictionary_names=['en_US']): self.dictionary_names = dictionary_names + self.dictionaries = [] self.load_dictionaries() def load_dictionaries(self): - self.dictionaries = [] for dictionary_name in self.dictionary_names: self.dictionaries.append(Dictionary(name=dictionary_name)) @@ -143,7 +143,7 @@ class Hunspell: # one line and not accidentally big chunks of the file! try: regexp = r'^'+re.escape(input_phrase)+r'.*?(?=/|$)' - patt_start = re.compile(regexp,re.MULTILINE|re.UNICODE) + patt_start = re.compile(regexp, re.MULTILINE|re.UNICODE) except: import traceback traceback.print_exc()
1
0
0
0
Results per page:
10
25
50
100
200