Grammalecte  Diff

Differences From Artifact [68590304c9]:

To Artifact [db5af827ce]:


359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
359
360
361
362
363
364
365






























366
367
368
369
370
371
372







-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-







        for (let oNode of this.dMinimizedNodes.values()) {
            oNode.addr = iAddr;
            iAddr += Math.max(oNode.arcs.size, 1) * nBytesNode;
        }
    }

    _createJSON (nMethod) {
        /*
            Format of the binary indexable dictionary:
            Each section is separated with 4 bytes of \0
            
            - Section Header:
                /pyfsa/[version]
                    * version is an ASCII string
            
            - Section Informations:
                /[tag_lang]
                /[number of chars]
                /[number of bytes for each arc]
                /[number of bytes for each address node]
                /[number of entries]
                /[number of nodes]
                /[number of arcs]
                /[number of affixes]
                    * each field is a ASCII string
                /[stemming code]
                    * "S" means stems are generated by /suffix_code/, "A" means they are generated by /affix_code/
                      See defineSuffixCode() and defineAffixCode() for details.
                      "N" means no stemming
            
            - Section Values:
                    * a list of strings encoded in binary from utf-8, each value separated with a tabulation
            
            - Section Word Graph (nodes / arcs)
                    * A list of nodes which are a list of arcs with an address of the next node.
                      See DawgNode.convToBytes() for details.
        */
        let sByDic = "";
        if (nMethod == 1) {
            sByDic = this.oRoot.convToBytes1(this.nBytesArc, this.nBytesNodeAddress);
            for (let oNode of this.dMinimizedNodes.values()) {
                sByDic += oNode.convToBytes1(this.nBytesArc, this.nBytesNodeAddress);
            }
        }