Overview
Comment: | [core][js] str_transform as object |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core | webext2 |
Files: | files | file ages | folders |
SHA3-256: |
917994adcdc243056c5add97bd7284e4 |
User & Date: | olr on 2017-07-31 15:42:56 |
Other Links: | branch diff | manifest | tags |
Context
2017-07-31
| ||
15:56 | [core][js] phonet as object check-in: 455f677793 user: olr tags: core, webext2 | |
15:42 | [core][js] str_transform as object check-in: 917994adcd user: olr tags: core, webext2 | |
15:35 | [core][js] text as object check-in: 00c7447643 user: olr tags: core, webext2 | |
Changes
Modified gc_core/js/str_transform.js from [0fafeda9a5] to [9b41fc7a14].
1 2 | //// STRING TRANSFORMATION | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < > > | < | | | | | | > | < | | | | | | | | | > | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | //// STRING TRANSFORMATION // Note: 48 is the ASCII code for "0" var str_transform = { getStemFromSuffixCode: function (sFlex, sSfxCode) { // Suffix only if (sSfxCode == "0") { return sFlex; } return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1); }, getStemFromAffixCode: function (sFlex, sAffCode) { // Prefix and suffix if (sAffCode == "0") { return sFlex; } if (!sAffCode.includes("/")) { return "# error #"; } let [sPfxCode, sSfxCode] = sAffCode.split('/'); sFlex = sPfxCode.slice(1) + sFlex.slice(sPfxCode.charCodeAt(0)-48); return sSfxCode[0] == '0' ? sFlex + sSfxCode.slice(1) : sFlex.slice(0, -(sSfxCode.charCodeAt(0)-48)) + sSfxCode.slice(1); } } if (typeof(exports) !== 'undefined') { exports.getStemFromSuffixCode = str_transform.getStemFromSuffixCode; exports.getStemFromAffixCode = str_transform.getStemFromAffixCode; } |