Overview
Comment: | [lo] update the enumerator |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | lo |
Files: | files | file ages | folders |
SHA3-256: |
ff502ce05ce2c02a162fa85be99356cb |
User & Date: | olr on 2018-02-22 06:41:41 |
Other Links: | manifest | tags |
Context
2018-02-23
| ||
18:00 | [lo] update: enumerator check-in: 069bc48028 user: olr tags: trunk, lo | |
2018-02-22
| ||
06:41 | [lo] update the enumerator check-in: ff502ce05c user: olr tags: trunk, lo | |
2018-02-21
| ||
19:16 | [lo] New feature: enumerator check-in: 8607122157 user: olr tags: trunk, new_feature, lo | |
Changes
Modified gc_lang/fr/oxt/Lexicographer/Enumerator.py from [96cb003561] to [b4f8f7a9c3].
1 2 3 4 5 6 7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - | # Dictionary Options # by Olivier R. # License: MPL 2 import unohelper import uno import traceback |
︙ | |||
54 55 56 57 58 59 60 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + - + - + - - - - + + + + - - + + - - - - + + + + - + - + - + | xColumnModel.addColumn(xCol) for k, w in kwargs.items(): setattr(xGridModel, k, w) self.xDialog.insertByName(name, xGridModel) return xGridModel def run (self, sLang): |
︙ | |||
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | + + + + | self.xContainer.createPeer(toolkit, None) self.xContainer.execute() # XActionListener def actionPerformed (self, xActionEvent): try: if xActionEvent.ActionCommand == "Count": self.setTitleOfFirstColumn(self.dUI.get("words", "#err")) self.count() elif xActionEvent.ActionCommand == "CountByLemma": self.setTitleOfFirstColumn(self.dUI.get("lemmas", "#err")) self.count(bByLemma=True) elif xActionEvent.ActionCommand == "UnknownWords": self.setTitleOfFirstColumn(self.dUI.get("unknown_words", "#err")) self.count(bOnlyUnknownWords=True) elif xActionEvent.ActionCommand == "Tag": pass elif xActionEvent.ActionCommand == "Close": self.xContainer.endExecute() except: traceback.print_exc() # XJobExecutor def trigger (self, args): try: xDialog = Enumerator(self.ctx) xDialog.run() except: traceback.print_exc() # Code def getParagraphsOfText (self): "generator: returns full document text paragraph by paragraph" xCursor = self.xDocument.Text.createTextCursor() #helpers.xray(xCursor) xCursor.gotoStart(False) xCursor.gotoEndOfParagraph(True) yield xCursor.getString() while xCursor.gotoNextParagraph(False): xCursor.gotoEndOfParagraph(True) yield xCursor.getString() |
︙ | |||
183 184 185 186 187 188 189 | 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | - + + + + + + | i = 0 nTotOccur = 0 for k, w in sorted(dWord.items(), key=lambda t: t[1], reverse=True): xGridDataModel.addRow(i, (k, w)) i += 1 nTotOccur += w self.xNumWord.Label = str(i) |
Modified gc_lang/fr/oxt/Lexicographer/enum_strings.py from [9bc4695a29] to [24e7eb324a].
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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 33 34 35 36 37 38 39 40 41 42 43 44 45 | - - + + + + + + - - + + + + + + | def getUI (sLang): if sLang in dStrings: return dStrings[sLang] return dStrings["fr"] dStrings = { "fr": { "title": "Grammalecte · Recenseur", "list_section": "Calcul des occurrences des mots", "count_button": "Compter tout", "count2_button": "Compter par lemme", "unknown_button": "Mots inconnus", |