Grammalecte  Check-in [51a40c07e3]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[graphspell][core][build][lo] remove extended dictionary
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | core | build | lo | graphspell
Files: files | file ages | folders
SHA3-256:51a40c07e38502d8732c022b17231a85f3f2b99dd27c11f1c3eda98cc11a02d6
User & Date: olr 2019-04-04 07:23:07
Context
2019-04-04
08:03
[graphspell] suggestions with trailing numbers: avoid to repeat splitting for each dictionary check-in: e32c092585 user: olr tags: graphspell, trunk
07:23
[graphspell][core][build][lo] remove extended dictionary check-in: 51a40c07e3 user: olr tags: build, core, graphspell, lo, trunk
2019-04-03
20:04
[fr] phonet_simil: quota/cota check-in: 8fced24da3 user: olr tags: fr, trunk
Changes

Changes to gc_core/js/lang_core/gc_engine.js.

    64     64   
    65     65       //// Initialization
    66     66   
    67     67       load: function (sContext="JavaScript", sColorType="aRGB", sPath="") {
    68     68           try {
    69     69               if(typeof(process) !== 'undefined') {
    70     70                   var spellchecker = require("../graphspell/spellchecker.js");
    71         -                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
           71  +                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
    72     72               } else if (typeof(require) !== 'undefined') {
    73     73                   var spellchecker = require("resource://grammalecte/graphspell/spellchecker.js");
    74         -                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
           74  +                _oSpellChecker = new spellchecker.SpellChecker("${lang}", "", "${dic_main_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
    75     75               } else {
    76         -                _oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_extended_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
           76  +                _oSpellChecker = new SpellChecker("${lang}", sPath, "${dic_main_filename_js}", "${dic_community_filename_js}", "${dic_personal_filename_js}");
    77     77               }
    78     78               _sAppContext = sContext;
    79     79               _dOptions = gc_options.getOptions(sContext).gl_shallowCopy();     // duplication necessary, to be able to reset to default
    80     80               _dOptionsColors = gc_options.getOptionsColors(sContext, sColorType);
    81     81               _oTokenizer = _oSpellChecker.getTokenizer();
    82     82               _oSpellChecker.activateStorage();
    83     83           }

Changes to gc_core/py/lang_core/gc_engine.py.

    58     58       "initialization of the grammar checker"
    59     59       global _oSpellChecker
    60     60       global _sAppContext
    61     61       global _dOptions
    62     62       global _dOptionsColors
    63     63       global _oTokenizer
    64     64       try:
    65         -        _oSpellChecker = SpellChecker("${lang}", "${dic_main_filename_py}", "${dic_extended_filename_py}", "${dic_community_filename_py}", "${dic_personal_filename_py}")
           65  +        _oSpellChecker = SpellChecker("${lang}", "${dic_main_filename_py}", "${dic_community_filename_py}", "${dic_personal_filename_py}")
    66     66           _sAppContext = sContext
    67     67           _dOptions = dict(gc_options.getOptions(sContext))   # duplication necessary, to be able to reset to default
    68     68           _dOptionsColors = gc_options.getOptionsColors(sContext, sColorType)
    69     69           _oTokenizer = _oSpellChecker.getTokenizer()
    70     70           _oSpellChecker.activateStorage()
    71     71       except:
    72     72           traceback.print_exc()

Changes to gc_lang/fr/config.ini.

    18     18   lexicon_src = lexicons/French.lex
    19     19   dic_filenames = fr-allvars,fr-classic,fr-reform
    20     20   dic_name = fr-allvars,fr-classic,fr-reform
    21     21   dic_description = Français (Toutes variantes),Français (Classique),Français (Réforme 1990)
    22     22   dic_filter = ,[*CMPX]$,[*RPX]$
    23     23   dic_default_filename_py = fr-allvars
    24     24   dic_default_filename_js = fr-allvars
    25         -# extended dictionary
    26         -lexicon_extended_src = lexicons/French.extended.lex
    27         -dic_extended_filename = fr.extended
    28         -dic_extended_name = fr.extended
    29         -dic_extended_description = Français - dictionnaire étendu
    30     25   # community dictionary
    31     26   lexicon_community_src = lexicons/French.community.lex
    32     27   dic_community_filename = fr.community
    33     28   dic_community_name = fr.community
    34     29   dic_community_description = Français - dictionnaire communautaire
    35     30   # personal dictionary
    36     31   lexicon_personal_src = lexicons/French.personal.lex

Changes to gc_lang/fr/oxt/Graphspell.py.

    62     62                   sPersonalDicJSON = self.xOptionNode.getPropertyValue("personal_dic")
    63     63                   if sPersonalDicJSON:
    64     64                       try:
    65     65                           personal_dic = json.loads(sPersonalDicJSON)
    66     66                       except:
    67     67                           print("Graphspell: wrong personal_dic")
    68     68                           traceback.print_exc()
    69         -            self.oGraphspell = SpellChecker("fr", "fr-"+sMainDicName+".bdic", "", "", personal_dic)
           69  +            self.oGraphspell = SpellChecker("fr", "fr-"+sMainDicName+".bdic", "", personal_dic)
    70     70               self.loadHunspell()
    71     71               # print("Graphspell: init done")
    72     72           except:
    73     73               print("Graphspell: init failed")
    74     74               traceback.print_exc()
    75         -    
           75  +
    76     76       def loadHunspell (self):
    77     77           # Hunspell is a fallback spellchecker
    78     78           try:
    79     79               self.xHunspell = self.xSvMgr.createInstance("org.openoffice.lingu.MySpellSpellChecker")
    80     80           except:
    81     81               print("Hunspell: init failed")
    82     82               traceback.print_exc()
................................................................................
   104    104       def hasLocale (self, aLocale):
   105    105           if aLocale in self.locales:
   106    106               return True
   107    107           for e in self.locales:
   108    108               if aLocale.Language == e.Language and (e.Country == aLocale.Country or e.Country == ""):
   109    109                   return True
   110    110           return False
   111         -    
          111  +
   112    112       def getLocales (self):
   113    113           return self.locales
   114         -    
          114  +
   115    115       # XSpellChecker
   116    116       # http://www.openoffice.org/api/docs/common/ref/com/sun/star/linguistic2/XSpellChecker.html
   117    117       def isValid (self, aWord, rLocale, aProperties):
   118    118           try:
   119    119               aWord = zElidedWords.sub("", aWord.rstrip("."), count=1)
   120    120               return self.oGraphspell.isValidToken(aWord)
   121    121               # return self.xHunspell.isValid(aWord, self.xHunspellLocale, aProperties)
................................................................................
   153    153               #self.xFallbackSpellChecker = self.xSvMgr.createInstance(sSpellchecker)
   154    154               #if self.xFallbackSpellChecker:
   155    155               #    print("Spell checker: %s" % xSpellChecker)
   156    156               #    break
   157    157   
   158    158   
   159    159   class SpellAlternatives (unohelper.Base, XSpellAlternatives):
   160         -    
          160  +
   161    161       def __init__ (self, sWord, lSugg):
   162    162           try:
   163    163               self.sWord = sWord
   164    164               self.lSugg = lSugg
   165    165               self.xLocale = Locale('fr', 'FR', '')
   166    166           except:
   167    167               traceback.print_exc()
   168         -    
          168  +
   169    169       # XSpellAlternatives
   170    170       # http://www.openoffice.org/api/docs/common/ref/com/sun/star/linguistic2/XSpellAlternatives.html
   171    171       def getWord (self):
   172    172           return self.sWord
   173         -    
          173  +
   174    174       def getLocale (self):
   175    175           return self.xLocale
   176         -    
          176  +
   177    177       def getFailureType (self):
   178    178           return 4
   179    179           # IS_NEGATIVE_WORD = 2
   180    180           #   The word is a negative one, that is, it should not be used.
   181    181           # CAPTION_ERROR = 3
   182    182           #   The capitalization of the word is wrong.
   183    183           # SPELLING_ERROR = 4
   184    184           #   The spelling of the word is wrong (or at least not known to be correct).
   185    185           # No difference -> red underline
   186         -    
          186  +
   187    187       def getAlternativesCount (self):
   188    188           return len(self.lSugg)
   189         -    
          189  +
   190    190       def getAlternatives (self):
   191    191           return self.lSugg
   192    192   
   193    193   
   194    194   g_ImplementationHelper = unohelper.ImplementationHelper()
   195    195   g_ImplementationHelper.addImplementation(Graphspell, "net.grammalecte.graphspell", ("com.sun.star.linguistic2.SpellChecker",),)

Changes to graphspell-js/spellchecker.js.

     1      1   // Spellchecker
     2      2   // Wrapper for the IBDAWG class.
     3      3   // Useful to check several dictionaries at once.
     4      4   
     5      5   // To avoid iterating over a pile of dictionaries, it is assumed that 3 are enough:
     6      6   // - the main dictionary, bundled with the package
     7         -// - the extended dictionary
     8         -// - the community dictionary, added by an organization
            7  +// - the community dictionary, a merge of different external dictionaries
     9      8   // - the personal dictionary, created by the user for its own convenience
    10      9   
    11     10   /* jshint esversion:6, -W097 */
    12     11   /* jslint esversion:6 */
    13     12   /* global require, exports, console, IBDAWG, Tokenizer */
    14     13   
    15     14   "use strict";
................................................................................
    29     28       ["fr", "fr-allvars.json"],
    30     29       ["en", "en.json"]
    31     30   ]);
    32     31   
    33     32   
    34     33   class SpellChecker {
    35     34   
    36         -    constructor (sLangCode, sPath="", mainDic="", extentedDic="", communityDic="", personalDic="") {
           35  +    constructor (sLangCode, sPath="", mainDic="", communityDic="", personalDic="") {
    37     36           // returns true if the main dictionary is loaded
    38     37           this.sLangCode = sLangCode;
    39     38           if (!mainDic) {
    40     39               mainDic = dDefaultDictionaries.gl_get(sLangCode, "");
    41     40           }
    42     41           this.oMainDic = this._loadDictionary(mainDic, sPath, true);
    43         -        this.oExtendedDic = this._loadDictionary(extentedDic, sPath);
    44     42           this.oCommunityDic = this._loadDictionary(communityDic, sPath);
    45     43           this.oPersonalDic = this._loadDictionary(personalDic, sPath);
    46         -        this.bExtendedDic = Boolean(this.oExtendedDic);
    47     44           this.bCommunityDic = Boolean(this.oCommunityDic);
    48     45           this.bPersonalDic = Boolean(this.oPersonalDic);
    49     46           this.oTokenizer = null;
    50     47           // storage
    51     48           this.bStorage = false;
    52     49           this._dMorphologies = new Map();            // key: flexion, value: list of morphologies
    53     50           this._dLemmas = new Map();                  // key: flexion, value: list of lemmas
................................................................................
    93     90   
    94     91       setMainDictionary (dictionary, sPath="") {
    95     92           // returns true if the dictionary is loaded
    96     93           this.oMainDic = this._loadDictionary(dictionary, sPath, true);
    97     94           return Boolean(this.oMainDic);
    98     95       }
    99     96   
   100         -    setExtendedDictionary (dictionary, sPath="", bActivate=true) {
   101         -        // returns true if the dictionary is loaded
   102         -        this.oExtendedDic = this._loadDictionary(dictionary, sPath);
   103         -        this.bExtendedDic = (bActivate) ? Boolean(this.oExtendedDic) : false;
   104         -        return Boolean(this.oExtendedDic);
   105         -    }
   106         -
   107     97       setCommunityDictionary (dictionary, sPath="", bActivate=true) {
   108     98           // returns true if the dictionary is loaded
   109     99           this.oCommunityDic = this._loadDictionary(dictionary, sPath);
   110    100           this.bCommunityDic = (bActivate) ? Boolean(this.oCommunityDic) : false;
   111    101           return Boolean(this.oCommunityDic);
   112    102       }
   113    103   
................................................................................
   114    104       setPersonalDictionary (dictionary, sPath="", bActivate=true) {
   115    105           // returns true if the dictionary is loaded
   116    106           this.oPersonalDic = this._loadDictionary(dictionary, sPath);
   117    107           this.bPersonalDic = (bActivate) ? Boolean(this.oPersonalDic) : false;
   118    108           return Boolean(this.oPersonalDic);
   119    109       }
   120    110   
   121         -    activateExtendedDictionary () {
   122         -        this.bExtendedDic = Boolean(this.oExtendedDic);
   123         -    }
   124         -
   125    111       activateCommunityDictionary () {
   126    112           this.bCommunityDic = Boolean(this.oCommunityDic);
   127    113       }
   128    114   
   129    115       activatePersonalDictionary () {
   130    116           this.bPersonalDic = Boolean(this.oPersonalDic);
   131    117       }
   132    118   
   133         -    deactivateExtendedDictionary () {
   134         -        this.bExtendedDic = false;
   135         -    }
   136         -
   137    119       deactivateCommunityDictionary () {
   138    120           this.bCommunityDic = false;
   139    121       }
   140    122   
   141    123       deactivatePersonalDictionary () {
   142    124           this.bPersonalDic = false;
   143    125       }
................................................................................
   177    159       // IBDAWG functions
   178    160   
   179    161       isValidToken (sToken) {
   180    162           // checks if sToken is valid (if there is hyphens in sToken, sToken is split, each part is checked)
   181    163           if (this.oMainDic.isValidToken(sToken)) {
   182    164               return true;
   183    165           }
   184         -        if (this.bExtendedDic && this.oExtendedDic.isValidToken(sToken)) {
   185         -            return true;
   186         -        }
   187    166           if (this.bCommunityDic && this.oCommunityDic.isValidToken(sToken)) {
   188    167               return true;
   189    168           }
   190    169           if (this.bPersonalDic && this.oPersonalDic.isValidToken(sToken)) {
   191    170               return true;
   192    171           }
   193    172           return false;
................................................................................
   194    173       }
   195    174   
   196    175       isValid (sWord) {
   197    176           // checks if sWord is valid (different casing tested if the first letter is a capital)
   198    177           if (this.oMainDic.isValid(sWord)) {
   199    178               return true;
   200    179           }
   201         -        if (this.bExtendedDic && this.oExtendedDic.isValid(sWord)) {
   202         -            return true;
   203         -        }
   204    180           if (this.bCommunityDic && this.oCommunityDic.isValid(sWord)) {
   205    181               return true;
   206    182           }
   207    183           if (this.bPersonalDic && this.oPersonalDic.isValid(sWord)) {
   208    184               return true;
   209    185           }
   210    186           return false;
................................................................................
   211    187       }
   212    188   
   213    189       lookup (sWord) {
   214    190           // checks if sWord is in dictionary as is (strict verification)
   215    191           if (this.oMainDic.lookup(sWord)) {
   216    192               return true;
   217    193           }
   218         -        if (this.bExtendedDic && this.oExtendedDic.lookup(sWord)) {
   219         -            return true;
   220         -        }
   221    194           if (this.bCommunityDic && this.oCommunityDic.lookup(sWord)) {
   222    195               return true;
   223    196           }
   224    197           if (this.bPersonalDic && this.oPersonalDic.lookup(sWord)) {
   225    198               return true;
   226    199           }
   227    200           return false;
................................................................................
   229    202   
   230    203       getMorph (sWord) {
   231    204           // retrieves morphologies list, different casing allowed
   232    205           if (this.bStorage && this._dMorphologies.has(sWord)) {
   233    206               return this._dMorphologies.get(sWord);
   234    207           }
   235    208           let lMorph = this.oMainDic.getMorph(sWord);
   236         -        if (this.bExtendedDic) {
   237         -            lMorph.push(...this.oExtendedDic.getMorph(sWord));
   238         -        }
   239    209           if (this.bCommunityDic) {
   240    210               lMorph.push(...this.oCommunityDic.getMorph(sWord));
   241    211           }
   242    212           if (this.bPersonalDic) {
   243    213               lMorph.push(...this.oPersonalDic.getMorph(sWord));
   244    214           }
   245    215           if (this.bStorage) {
................................................................................
   260    230           }
   261    231           return Array.from(new Set(this.getMorph(sWord).map((sMorph) => { return sMorph.slice(1, sMorph.indexOf("/")); })));
   262    232       }
   263    233   
   264    234       * suggest (sWord, nSuggLimit=10) {
   265    235           // generator: returns 1, 2 or 3 lists of suggestions
   266    236           yield this.oMainDic.suggest(sWord, nSuggLimit);
   267         -        if (this.bExtendedDic) {
   268         -            yield this.oExtendedDic.suggest(sWord, nSuggLimit);
   269         -        }
   270    237           if (this.bCommunityDic) {
   271    238               yield this.oCommunityDic.suggest(sWord, nSuggLimit);
   272    239           }
   273    240           if (this.bPersonalDic) {
   274    241               yield this.oPersonalDic.suggest(sWord, nSuggLimit);
   275    242           }
   276    243       }
   277    244   
   278    245       * select (sFlexPattern="", sTagsPattern="") {
   279    246           // generator: returns all entries which flexion fits <sFlexPattern> and morphology fits <sTagsPattern>
   280    247           yield* this.oMainDic.select(sFlexPattern, sTagsPattern);
   281         -        if (this.bExtendedDic) {
   282         -            yield* this.oExtendedDic.select(sFlexPattern, sTagsPattern);
   283         -        }
   284    248           if (this.bCommunityDic) {
   285    249               yield* this.oCommunityDic.select(sFlexPattern, sTagsPattern);
   286    250           }
   287    251           if (this.bPersonalDic) {
   288    252               yield* this.oPersonalDic.select(sFlexPattern, sTagsPattern);
   289    253           }
   290    254       }
   291    255   
   292    256       getSimilarEntries (sWord, nSuggLimit=10) {
   293    257           // return a list of tuples (similar word, stem, morphology)
   294    258           let lResult = this.oMainDic.getSimilarEntries(sWord, nSuggLimit);
   295         -        if (this.bExtendedDic) {
   296         -            lResult.push(...this.oExtendedDic.getSimilarEntries(sWord, nSuggLimit));
   297         -        }
   298    259           if (this.bCommunityDic) {
   299    260               lResult.push(...this.oCommunityDic.getSimilarEntries(sWord, nSuggLimit));
   300    261           }
   301    262           if (this.bPersonalDic) {
   302    263               lResult.push(...this.oPersonalDic.getSimilarEntries(sWord, nSuggLimit));
   303    264           }
   304    265           return lResult;
   305    266       }
   306    267   }
   307    268   
   308    269   if (typeof(exports) !== 'undefined') {
   309    270       exports.SpellChecker = SpellChecker;
   310    271   }

Changes to graphspell/spellchecker.py.

    21     21       "en": "en.bdic"
    22     22   }
    23     23   
    24     24   
    25     25   class SpellChecker ():
    26     26       "SpellChecker: wrapper for the IBDAWG class"
    27     27   
    28         -    def __init__ (self, sLangCode, sfMainDic="", sfExtendedDic="", sfCommunityDic="", sfPersonalDic=""):
           28  +    def __init__ (self, sLangCode, sfMainDic="", sfCommunityDic="", sfPersonalDic=""):
    29     29           "returns True if the main dictionary is loaded"
    30     30           self.sLangCode = sLangCode
    31     31           if not sfMainDic:
    32     32               sfMainDic = dDefaultDictionaries.get(sLangCode, "")
    33     33           self.oMainDic = self._loadDictionary(sfMainDic, True)
    34         -        self.oExtendedDic = self._loadDictionary(sfExtendedDic)
    35     34           self.oCommunityDic = self._loadDictionary(sfCommunityDic)
    36     35           self.oPersonalDic = self._loadDictionary(sfPersonalDic)
    37         -        self.bExtendedDic = bool(self.oExtendedDic)
    38     36           self.bCommunityDic = bool(self.oCommunityDic)
    39     37           self.bPersonalDic = bool(self.oPersonalDic)
    40     38           self.oTokenizer = None
    41     39           # Default suggestions
    42     40           self.dDefaultSugg = None
    43     41           self.loadSuggestions(sLangCode)
    44     42           # storage
................................................................................
    69     67           return self.oTokenizer
    70     68   
    71     69       def setMainDictionary (self, source):
    72     70           "returns True if the dictionary is loaded"
    73     71           self.oMainDic = self._loadDictionary(source, True)
    74     72           return bool(self.oMainDic)
    75     73   
    76         -    def setExtendedDictionary (self, source, bActivate=True):
    77         -        "returns True if the dictionary is loaded"
    78         -        self.oExtendedDic = self._loadDictionary(source)
    79         -        self.bExtendedDic = False  if not bActivate  else bool(self.oExtendedDic)
    80         -        return bool(self.oExtendedDic)
    81         -
    82     74       def setCommunityDictionary (self, source, bActivate=True):
    83     75           "returns True if the dictionary is loaded"
    84     76           self.oCommunityDic = self._loadDictionary(source)
    85     77           self.bCommunityDic = False  if not bActivate  else bool(self.oCommunityDic)
    86     78           return bool(self.oCommunityDic)
    87     79   
    88     80       def setPersonalDictionary (self, source, bActivate=True):
    89     81           "returns True if the dictionary is loaded"
    90     82           self.oPersonalDic = self._loadDictionary(source)
    91     83           self.bPersonalDic = False  if not bActivate  else bool(self.oPersonalDic)
    92     84           return bool(self.oPersonalDic)
    93     85   
    94         -    def activateExtendedDictionary (self):
    95         -        "activate extended dictionary (if available)"
    96         -        self.bExtendedDic = bool(self.oExtendedDic)
    97         -
    98     86       def activateCommunityDictionary (self):
    99     87           "activate community dictionary (if available)"
   100     88           self.bCommunityDic = bool(self.oCommunityDic)
   101     89   
   102     90       def activatePersonalDictionary (self):
   103     91           "activate personal dictionary (if available)"
   104     92           self.bPersonalDic = bool(self.oPersonalDic)
   105     93   
   106         -    def deactivateExtendedDictionary (self):
   107         -        "deactivate extended dictionary"
   108         -        self.bExtendedDic = False
   109         -
   110     94       def deactivateCommunityDictionary (self):
   111     95           "deactivate community dictionary"
   112     96           self.bCommunityDic = False
   113     97   
   114     98       def deactivatePersonalDictionary (self):
   115     99           "deactivate personal dictionary"
   116    100           self.bPersonalDic = False
................................................................................
   180    164   
   181    165       # IBDAWG functions
   182    166   
   183    167       def isValidToken (self, sToken):
   184    168           "checks if sToken is valid (if there is hyphens in sToken, sToken is split, each part is checked)"
   185    169           if self.oMainDic.isValidToken(sToken):
   186    170               return True
   187         -        if self.bExtendedDic and self.oExtendedDic.isValidToken(sToken):
   188         -            return True
   189    171           if self.bCommunityDic and self.oCommunityDic.isValidToken(sToken):
   190    172               return True
   191    173           if self.bPersonalDic and self.oPersonalDic.isValidToken(sToken):
   192    174               return True
   193    175           return False
   194    176   
   195    177       def isValid (self, sWord):
   196    178           "checks if sWord is valid (different casing tested if the first letter is a capital)"
   197    179           if self.oMainDic.isValid(sWord):
   198    180               return True
   199         -        if self.bExtendedDic and self.oExtendedDic.isValid(sWord):
   200         -            return True
   201    181           if self.bCommunityDic and self.oCommunityDic.isValid(sWord):
   202    182               return True
   203    183           if self.bPersonalDic and self.oPersonalDic.isValid(sWord):
   204    184               return True
   205    185           return False
   206    186   
   207    187       def lookup (self, sWord):
   208    188           "checks if sWord is in dictionary as is (strict verification)"
   209    189           if self.oMainDic.lookup(sWord):
   210    190               return True
   211         -        if self.bExtendedDic and self.oExtendedDic.lookup(sWord):
   212         -            return True
   213    191           if self.bCommunityDic and self.oCommunityDic.lookup(sWord):
   214    192               return True
   215    193           if self.bPersonalDic and self.oPersonalDic.lookup(sWord):
   216    194               return True
   217    195           return False
   218    196   
   219    197       def getMorph (self, sWord):
   220    198           "retrieves morphologies list, different casing allowed"
   221    199           if self.bStorage and sWord in self._dMorphologies:
   222    200               return self._dMorphologies[sWord]
   223    201           lMorph = self.oMainDic.getMorph(sWord)
   224         -        if self.bExtendedDic:
   225         -            lMorph.extend(self.oExtendedDic.getMorph(sWord))
   226    202           if self.bCommunityDic:
   227    203               lMorph.extend(self.oCommunityDic.getMorph(sWord))
   228    204           if self.bPersonalDic:
   229    205               lMorph.extend(self.oPersonalDic.getMorph(sWord))
   230    206           if self.bStorage:
   231    207               self._dMorphologies[sWord] = lMorph
   232    208               self._dLemmas[sWord] = set([ s[1:s.find("/")]  for s in lMorph ])
................................................................................
   248    224               elif sWord.istitle() and sWord.lower() in self.dDefaultSugg:
   249    225                   lRes = self.dDefaultSugg[sWord.lower()].split("|")
   250    226                   yield list(map(lambda sSugg: sSugg[0:1].upper()+sSugg[1:], lRes))
   251    227               else:
   252    228                   yield self.oMainDic.suggest(sWord, nSuggLimit)
   253    229           else:
   254    230               yield self.oMainDic.suggest(sWord, nSuggLimit)
   255         -        if self.bExtendedDic:
   256         -            yield self.oExtendedDic.suggest(sWord, nSuggLimit)
   257    231           if self.bCommunityDic:
   258    232               yield self.oCommunityDic.suggest(sWord, nSuggLimit)
   259    233           if self.bPersonalDic:
   260    234               yield self.oPersonalDic.suggest(sWord, nSuggLimit)
   261    235   
   262    236       def select (self, sFlexPattern="", sTagsPattern=""):
   263    237           "generator: returns all entries which flexion fits <sFlexPattern> and morphology fits <sTagsPattern>"
   264    238           yield from self.oMainDic.select(sFlexPattern, sTagsPattern)
   265         -        if self.bExtendedDic:
   266         -            yield from self.oExtendedDic.select(sFlexPattern, sTagsPattern)
   267    239           if self.bCommunityDic:
   268    240               yield from self.oCommunityDic.select(sFlexPattern, sTagsPattern)
   269    241           if self.bPersonalDic:
   270    242               yield from self.oPersonalDic.select(sFlexPattern, sTagsPattern)
   271    243   
   272    244       def drawPath (self, sWord):
   273    245           "draw the path taken by <sWord> within the word graph: display matching nodes and their arcs"
   274    246           self.oMainDic.drawPath(sWord)
   275         -        if self.bExtendedDic:
   276         -            print("-----")
   277         -            self.oExtendedDic.drawPath(sWord)
   278    247           if self.bCommunityDic:
   279    248               print("-----")
   280    249               self.oCommunityDic.drawPath(sWord)
   281    250           if self.bPersonalDic:
   282    251               print("-----")
   283    252               self.oPersonalDic.drawPath(sWord)
   284    253   
   285    254       def getSimilarEntries (self, sWord, nSuggLimit=10):
   286    255           "return a list of tuples (similar word, stem, morphology)"
   287    256           lResult = self.oMainDic.getSimilarEntries(sWord, nSuggLimit)
   288         -        if self.bExtendedDic:
   289         -            lResult.extend(self.oExtendedDic.getSimilarEntries(sWord, nSuggLimit))
   290    257           if self.bCommunityDic:
   291    258               lResult.extend(self.oCommunityDic.getSimilarEntries(sWord, nSuggLimit))
   292    259           if self.bPersonalDic:
   293    260               lResult.extend(self.oPersonalDic.getSimilarEntries(sWord, nSuggLimit))
   294    261           return lResult

Changes to make.py.

   307    307               dVars[sf[:-3]] = open("js_extension/"+sf, "r", encoding="utf-8").read()
   308    308           for sf in os.listdir("graphspell-js"):
   309    309               if not os.path.isdir("graphspell-js/"+sf):
   310    310                   file_util.copy_file("graphspell-js/"+sf, "grammalecte-js/graphspell")
   311    311                   helpers.copyAndFileTemplate("graphspell-js/"+sf, "grammalecte-js/graphspell/"+sf, dVars)
   312    312   
   313    313   
   314         -def copyGraphspellDictionaries (dVars, bJavaScript=False, bExtendedDict=False, bCommunityDict=False, bPersonalDict=False):
          314  +def copyGraphspellDictionaries (dVars, bJavaScript=False, bCommunityDict=False, bPersonalDict=False):
   315    315       "copy requested Graphspell dictionaries in Grammalecte package"
   316    316       dVars["dic_main_filename_py"] = ""
   317    317       dVars["dic_main_filename_js"] = ""
   318         -    dVars["dic_extended_filename_py"] = ""
   319         -    dVars["dic_extended_filename_js"] = ""
   320    318       dVars["dic_community_filename_py"] = ""
   321    319       dVars["dic_community_filename_js"] = ""
   322    320       dVars["dic_personal_filename_py"] = ""
   323    321       dVars["dic_personal_filename_js"] = ""
   324    322       lDict = [ ("main", s)  for s in dVars['dic_filenames'].split(",") ]
   325         -    if bExtendedDict:
   326         -        lDict.append(("extended", dVars['dic_extended_filename']))
   327    323       if bCommunityDict:
   328    324           lDict.append(("community", dVars['dic_community_filename']))
   329    325       if bPersonalDict:
   330    326           lDict.append(("personal", dVars['dic_personal_filename']))
   331    327       for sType, sFileName in lDict:
   332    328           spfPyDic = "graphspell/_dictionaries/" + sFileName + ".bdic"
   333    329           spfJSDic = "graphspell-js/_dictionaries/" + sFileName + ".json"
................................................................................
   351    347           lSfDictDst = dVars['dic_filenames'].split(",")
   352    348           lDicName = dVars['dic_name'].split(",")
   353    349           lDescription = dVars['dic_description'].split(",")
   354    350           lFilter = dVars['dic_filter'].split(",")
   355    351           for sfDictDst, sDicName, sDescription, sFilter in zip(lSfDictDst, lDicName, lDescription, lFilter):
   356    352               lex_build.build(spfLexSrc, dVars['lang'], dVars['lang_name'], sfDictDst, bJavaScript, sDicName, sDescription, sFilter, dVars['stemming_method'], int(dVars['fsa_method']))
   357    353       else:
   358         -        if sType == "extended":
   359         -            spfLexSrc = dVars['lexicon_extended_src']
   360         -            sfDictDst = dVars['dic_extended_filename']
   361         -            sDicName = dVars['dic_extended_name']
   362         -            sDescription = dVars['dic_extended_description']
   363         -        elif sType == "community":
          354  +        if sType == "community":
   364    355               spfLexSrc = dVars['lexicon_community_src']
   365    356               sfDictDst = dVars['dic_community_filename']
   366    357               sDicName = dVars['dic_community_name']
   367    358               sDescription = dVars['dic_community_description']
   368    359           elif sType == "personal":
   369    360               spfLexSrc = dVars['lexicon_personal_src']
   370    361               sfDictDst = dVars['dic_personal_filename']
................................................................................
   383    374       xParser.add_argument("-bb", "--build_data_before", help="launch build_data.py (only part 1: before dictionary building)", action="store_true")
   384    375       xParser.add_argument("-ba", "--build_data_after", help="launch build_data.py (only part 2: before dictionary building)", action="store_true")
   385    376       xParser.add_argument("-d", "--dict", help="generate FSA dictionary", action="store_true")
   386    377       xParser.add_argument("-t", "--tests", help="run unit tests", action="store_true")
   387    378       xParser.add_argument("-p", "--perf", help="run performance tests", action="store_true")
   388    379       xParser.add_argument("-pm", "--perf_memo", help="run performance tests and store results in perf_memo.txt", action="store_true")
   389    380       xParser.add_argument("-js", "--javascript", help="JavaScript build for Firefox", action="store_true")
   390         -    xParser.add_argument("-aed", "--add_extended_dictionary", help="add extended dictionary to the build", action="store_true")
   391    381       xParser.add_argument("-acd", "--add_community_dictionary", help="add community dictionary to the build", action="store_true")
   392    382       xParser.add_argument("-apd", "--add_personal_dictionary", help="add personal dictionary to the build", action="store_true")
   393    383       xParser.add_argument("-fx", "--firefox", help="Launch Firefox Developper for WebExtension testing", action="store_true")
   394    384       xParser.add_argument("-we", "--web_ext", help="Launch Firefox Nightly for WebExtension testing", action="store_true")
   395    385       xParser.add_argument("-l", "--lint_web_ext", help="web-ext lint on the WebExtension", action="store_true")
   396    386       xParser.add_argument("-tb", "--thunderbird", help="Launch Thunderbird", action="store_true")
   397    387       xParser.add_argument("-tbb", "--thunderbird_beta", help="Launch Thunderbird Beta", action="store_true")
................................................................................
   410    400       copyGraphspellCore(xArgs.javascript)
   411    401   
   412    402       for sLang in xArgs.lang:
   413    403           if os.path.exists("gc_lang/"+sLang) and os.path.isdir("gc_lang/"+sLang):
   414    404               xConfig = getConfig(sLang)
   415    405               dVars = xConfig._sections['args']
   416    406   
   417         -            if not dVars["lexicon_extended_src"]:
   418         -                xArgs.add_extended_dictionary = False
   419    407               if not dVars["lexicon_community_src"]:
   420    408                   xArgs.add_community_dictionary = False
   421    409               if not dVars["lexicon_personal_src"]:
   422    410                   xArgs.add_personal_dictionary = False
   423    411   
   424    412               # build data
   425    413               databuild = None
................................................................................
   429    417                       databuild = importlib.import_module("gc_lang."+sLang+".build_data")
   430    418                   except ImportError:
   431    419                       print("# Error. Couldn’t import file build_data.py in folder gc_lang/"+sLang)
   432    420               if databuild and xArgs.build_data_before:
   433    421                   databuild.before('gc_lang/'+sLang, dVars, xArgs.javascript)
   434    422               if xArgs.dict:
   435    423                   buildDictionary(dVars, "main", xArgs.javascript)
   436         -                if xArgs.add_extended_dictionary:
   437         -                    buildDictionary(dVars, "extended", xArgs.javascript)
   438    424                   if xArgs.add_community_dictionary:
   439    425                       buildDictionary(dVars, "community", xArgs.javascript)
   440    426                   if xArgs.add_personal_dictionary:
   441    427                       buildDictionary(dVars, "personal", xArgs.javascript)
   442    428               if databuild and xArgs.build_data_after:
   443    429                   databuild.after('gc_lang/'+sLang, dVars, xArgs.javascript)
   444    430   
   445    431               # copy dictionaries from Graphspell
   446         -            copyGraphspellDictionaries(dVars, xArgs.javascript, xArgs.add_extended_dictionary, xArgs.add_community_dictionary, xArgs.add_personal_dictionary)
          432  +            copyGraphspellDictionaries(dVars, xArgs.javascript, xArgs.add_community_dictionary, xArgs.add_personal_dictionary)
   447    433   
   448    434               # make
   449    435               sVersion = create(sLang, xConfig, xArgs.install, xArgs.javascript, xArgs.use_cache)
   450    436   
   451    437               # tests
   452    438               if xArgs.tests or xArgs.perf or xArgs.perf_memo:
   453    439                   print("> Running tests")