Index: graphspell-js/dawg.js ================================================================== --- graphspell-js/dawg.js +++ graphspell-js/dawg.js @@ -400,10 +400,11 @@ } } let oJSON = { "sName": this.sName, "nVersion": nMethod, + "sDate": this._getDate(), "sHeader": this.sHeader + nMethod + "/", "lArcVal": this.lArcVal, "nArcVal": this.nArcVal, "byDic": sByDic, // binary word graph "sLang": this.sLang, @@ -418,10 +419,19 @@ "nTag": this.nTag, "dChar": helpers.mapToObject(this.dChar), "nBytesOffset": 1 }; return oJSON; + }, + + _getDate () { + let oDate = new Date(); + let sMonth = (oDate.getMonth() + 1).toString().padStart(2, "0"); // Month+1: Because JS always sucks somehow. + let sDay = (oDate.getDay()).toString().padStart(2, "0"); + let sHours = (oDate.getHours()).toString().padStart(2, "0"); + let sMinutes = (oDate.getMinutes()).toString().padStart(2, "0"); + return `${oDate.getFullYear()}-${sMonth}-${sDay}, ${sHours}:${sMinutes}`; } } const oNodeCounter = { Index: graphspell-js/ibdawg.js ================================================================== --- graphspell-js/ibdawg.js +++ graphspell-js/ibdawg.js @@ -173,11 +173,11 @@ this.bOptNumSigle = true; this.bOptNumAtLast = false; } getInfo () { - return ` Language: ${this.sLang} Version: ${this.nVersion} Stemming: ${this.cStemming}FX\n` + + return ` Language: ${this.sLang} Version: ${this.nVersion} Date: ${this.sDate} Stemming: ${this.cStemming}FX\n` + ` Arcs values: ${this.nArcVal} = ${this.nChar} characters, ${this.nAff} affixes, ${this.nTag} tags\n` + ` Dictionary: ${this.nEntries} entries, ${this.nNode} nodes, ${this.nArc} arcs\n` + ` Address size: ${this.nBytesNodeAddress} bytes, Arc size: ${this.nBytesArc} bytes\n`; } Index: graphspell/ibdawg.py ================================================================== --- graphspell/ibdawg.py +++ graphspell/ibdawg.py @@ -3,10 +3,11 @@ import os import traceback import pkgutil import re from functools import wraps +import datetime import time #import logging #logging.basicConfig(filename="suggestions.log", level=logging.DEBUG) @@ -166,10 +167,11 @@ if bInJSModule: hDst.write('// JavaScript\n// Generated data (do not edit)\n\n"use strict";\n\nconst dictionary = ') hDst.write(json.dumps({ "sName": self.sName, "nVersion": self.nVersion, + "sDate": str(datetime.datetime.now())[:-7], "sHeader": self.sHeader, "lArcVal": self.lArcVal, "nArcVal": self.nArcVal, # JavaScript is a pile of shit, so Mozilla’s JS parser don’t like file bigger than 4 Mb! # So, if necessary, we use an hexadecimal string, that we will convert later in Firefox’s extension.