Overview
Comment: | [core] semantic (token) tags |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core | rg |
Files: | files | file ages | folders |
SHA3-256: |
93c718cc670039571013d28c5497ef40 |
User & Date: | olr on 2018-07-19 08:31:24 |
Other Links: | branch diff | manifest | tags |
Context
2018-07-19
| ||
08:51 | [build][core] new sign for sentence tags: % check-in: f875f6c740 user: olr tags: core, build, rg | |
08:31 | [core] semantic (token) tags check-in: 93c718cc67 user: olr tags: core, rg | |
07:34 | [core] gc engine: token tags (character: /) check-in: 81f21e06d4 user: olr tags: core, rg | |
Changes
Modified gc_core/py/lang_core/gc_engine.py from [177fbea14b] to [cc991a6483].
︙ | ︙ | |||
782 783 784 785 786 787 788 789 790 791 792 793 794 795 | globals()[sWhat](self.lToken, nTokenOffset) elif cActionType == ">": # we do nothing, this test is just a condition to apply all following actions if bDebug: print(" COND_OK") pass elif cActionType == "/": # sentence tags if bDebug: print(" SENTENCE_TAG:\n ", dRule[sRuleId]) nTokenTag = nTokenOffset + eAct[0] if sWhat not in self.dTags: self.dTags[sWhat] = (nTokenTag, nTokenTag) elif nTokenTag > self.dTags[sWhat][1]: | > > > > > > > > > > | 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 | globals()[sWhat](self.lToken, nTokenOffset) elif cActionType == ">": # we do nothing, this test is just a condition to apply all following actions if bDebug: print(" COND_OK") pass elif cActionType == "/": if bDebug: print(" SEMANTIC_TAG:\n ", dRule[sRuleId]) nTokenStart = nTokenOffset + eAct[0] nTokenEnd = nTokenOffset + eAct[1] for i in range(nTokenStart, nTokenEnd+1) if "tags" in self.lToken[i]: self.lToken[i]["tags"].update(sWhat.split("|")) else: self.lToken[i]["tags"] = set(sWhat.split("|")) elif cActionType == "%": # sentence tags if bDebug: print(" SENTENCE_TAG:\n ", dRule[sRuleId]) nTokenTag = nTokenOffset + eAct[0] if sWhat not in self.dTags: self.dTags[sWhat] = (nTokenTag, nTokenTag) elif nTokenTag > self.dTags[sWhat][1]: |
︙ | ︙ |