georgian-hyphenation 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,284 +1,398 @@
1
- # Georgian Language Hyphenation / ქართული ენის დამარცვლა
1
+ # Georgian Language Hyphenation
2
2
 
3
- **Version 2.2.2** (Library) / **2.0.8** (WordPress Plugin)
3
+ [![NPM version](https://img.shields.io/npm/v/georgian-hyphenation.svg)](https://www.npmjs.com/package/georgian-hyphenation)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![JavaScript](https://img.shields.io/badge/javascript-ESM-yellow.svg)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
6
+ [![Downloads](https://img.shields.io/npm/dm/georgian-hyphenation.svg)](https://www.npmjs.com/package/georgian-hyphenation)
4
7
 
5
- A comprehensive hyphenation library for the Georgian language, using advanced linguistic algorithms for accurate syllabification.
8
+ **Version 2.2.4** - Browser + Node.js Compatible with Dictionary Support
6
9
 
7
- ქართული ენის სრული დამარცვლის ბიბლიოთეკა, რომელიც იყენებს თანამედროვე ლინგვისტურ ალგორითმებს ზუსტი მარცვლების გამოყოფისთვის.
10
+ ქართული ენის სრული დამარცვლის ბიბლიოთეკა. ვერსია 2.2.4 სრულად თავსებადია როგორც Browser, ისე Node.js გარემოსთან.
8
11
 
9
12
  ---
10
13
 
11
- ## ✨ Features / ფუნქციები
14
+ ## ✨ New in v2.2.4
12
15
 
13
- ### 🌟 New in v2.2.2 (Documentation Update)
16
+ - 🌐 **Full Browser Support**: CDN URL fixed for reliable dictionary loading in browsers
17
+ - 📦 **NPM Package Files**: Added `data/` folder to published package
18
+ - 🔧 **Improved Error Handling**: Better fallback when dictionary is unavailable
19
+ - 📝 **Documentation**: Corrected examples (removed non-existent Georgian words)
14
20
 
15
- * **📝 Corrected Examples**: გამოსწორდა არასწორი მაგალითები დოკუმენტაციაში (მაგ: არასწორი "კლასსი" → წაშლილია).
16
- * **📚 Python README**: განახლდა Python package-ის README სრული და ზუსტი დოკუმენტაციით.
17
- * **✅ PyPI Update**: ხელახლა გამოქვეყნდა PyPI-ზე გასწორებული README-ით.
18
-
19
- ### 🌟 v2.2.1 Features
20
-
21
- * **🧹 Automatic Sanitization**: ბიბლიოთეკა ავტომატურად ცნობს და შლის ტექსტში უკვე არსებულ დამარცვლის ნიშნებს (Soft-hyphens) დამუშავებამდე. ეს გამორიცხავს "ორმაგი დამარცვლის" შეცდომას.
22
- * **📚 Dictionary Integration**: მხარდაჭერილია გამონაკლისების ლექსიკონი (`exceptions.json`), რომელიც პრიორიტეტულია ალგორითმთან შედარებით რთული სიტყვების დამუშავებისას.
23
- * **⚡ High Performance**: ჰარმონიული ჯგუფების ძებნა ოპტიმიზირებულია `Set` სტრუქტურით, რაც უზრუნველყოფს მყისიერ დამუშავებას (O(1) complexity) დიდ ტექსტებზეც კი.
24
- * **📦 Modern ESM**: სრული თავსებადობა თანამედროვე JavaScript სტანდარტებთან (`import/export`), რაც აადვილებს ინტეგრაციას Vite, React და Vue პროექტებში.
25
-
26
- ### 🎓 v2.2 Academic Logic (Linguistic Core)
27
-
28
- * **🧠 Phonological Distance Analysis**: ხმოვნებს შორის მანძილის ჭკვიანი გაზომვა ზუსტი დამარცვლისთვის.
29
- * **🛡️ Anti-Orphan Protection**: ხელს უშლის სიტყვის დასაწყისში ან ბოლოში ერთი ასოს მარტო დატოვებას (მინიმუმ 2 სიმბოლო თითოეულ მხარეს).
30
- * **🎼 Harmonic Clusters Support**: სპეციალური წესები ქართული ჰარმონიული თანხმოვნებისთვის (მაგ: `ბრ`, `წვ`, `მთ`), რომლებიც დამარცვლისას არ იშლება.
31
- * **🔄 Hiatus Handling**: ხმოვანთშერწყმის (V-V) სწორი დამუშავება (მაგ: `გა-ა-ნა-ლი-ზა`).
21
+ ---
32
22
 
33
- ### 🚀 Integration & Flexibility
23
+ ## Features from v2.2.2
34
24
 
35
- * **Multi-Platform**: ხელმისაწვდომია Python, JavaScript (Node & Browser), WordPress და Browser Extensions პლატფორმებისთვის.
36
- * **Universal Formats**: მხარდაჭერილია Soft-hyphen (\u00AD), ვიზუალური ტირე, TeX patterns და Hunspell ფორმატები.
37
- * **Zero Dependencies**: ბიბლიოთეკა არის სრულიად დამოუკიდებელი და მსუბუქი (~5KB).
38
- * **Punctuation Aware**: ტექსტის დამუშავებისას ინარჩუნებს სასვენ ნიშნებს, ციფრებს და ლათინურ სიმბოლოებს.
25
+ - 🧹 **Automatic Sanitization**: Strips existing soft-hyphens before processing to prevent double-hyphenation
26
+ - 📚 **Dictionary Support**: 150+ exception words for edge cases
27
+ - **Performance Boost**: Harmonic cluster lookups optimized using `Set` (O(1) complexity)
28
+ - 📦 **Modern ESM Support**: Native `import/export` syntax
29
+ - 🎯 **Hybrid Engine**: Dictionary-first, Algorithm fallback
39
30
 
40
31
  ---
41
32
 
42
- ## 🧠 Algorithm Logic / ალგორითმის ლოგიკა
43
-
44
- ბიბლიოთეკა იყენებს აკადემიურ ფონოლოგიურ ანალიზს, რომელიც ეფუძნება ხმოვნებს შორის მანძილს და თანხმოვნების ტიპებს. v2.2 ვერსიაში დამატებულია წინასწარი გასუფთავების ფენა (Sanitization).
33
+ ## 📦 Installation
34
+ ```bash
35
+ npm install georgian-hyphenation
36
+ ```
45
37
 
46
- ### 1. წინასწარი დამუშავება (Sanitization)
38
+ ---
47
39
 
48
- დამარცვლის დაწყებამდე სისტემა ასრულებს შემდეგ ნაბიჯებს:
40
+ ## 🚀 Quick Start
49
41
 
50
- * **Cleaning**: ტექსტიდან იშლება ყველა არსებული დამარცვლის სიმბოლო (`\u00AD` ან `-`), რათა თავიდან ავიცილოთ ორმაგი დამარცვლა.
51
- * **Validation**: მოკლე სიტყვები (4 სიმბოლოზე ნაკლები) და სიტყვები ხმოვნების გარეშე ავტომატურად გამოიტოვება.
42
+ ### Browser (CDN)
43
+ ```html
44
+ <!DOCTYPE html>
45
+ <html>
46
+ <head>
47
+ <meta charset="UTF-8">
48
+ <style>
49
+ .hyphenated {
50
+ hyphens: manual;
51
+ -webkit-hyphens: manual;
52
+ text-align: justify;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body>
57
+ <div class="hyphenated" id="content"></div>
58
+
59
+ <script type="module">
60
+ import GeorgianHyphenator from 'https://cdn.jsdelivr.net/npm/georgian-hyphenation@2.2.4/src/javascript/index.js';
61
+
62
+ async function initialize() {
63
+ const hyphenator = new GeorgianHyphenator('\u00AD'); // Soft hyphen
64
+
65
+ // Load dictionary (optional, but recommended)
66
+ await hyphenator.loadDefaultLibrary();
67
+
68
+ const text = "საქართველო არის ძალიან ლამაზი ქვეყანა, სადაც ბევრი ისტორიული ძეგლია.";
69
+ document.getElementById('content').textContent = hyphenator.hyphenateText(text);
70
+ }
71
+
72
+ initialize();
73
+ </script>
74
+ </body>
75
+ </html>
76
+ ```
52
77
 
53
- ### 2. ხმოვანთა მანძილის ანალიზი
78
+ ---
54
79
 
55
- ალგორითმი პოულობს ხმოვნების ინდექსებს და ითვლის მანძილს მათ შორის:
80
+ ### Node.js (ESM)
81
+ ```javascript
82
+ import GeorgianHyphenator from 'georgian-hyphenation';
56
83
 
57
- * **V-V:** იყოფა ხმოვნებს შორის.
84
+ const hyphenator = new GeorgianHyphenator('-'); // Visible hyphen
58
85
 
59
- > მაგალითი: **`გა-ა-ი-ა-რა-ღა`**
86
+ // Hyphenate a word
87
+ console.log(hyphenator.hyphenate('საქართველო'));
88
+ // Output: "სა-ქარ-თვე-ლო"
60
89
 
61
- * **V-C-V:** იყოფა პირველი ხმოვნის შემდეგ.
90
+ // Load dictionary (optional)
91
+ await hyphenator.loadDefaultLibrary();
62
92
 
63
- > მაგალითი: `მა-მა`, `დე-და`
93
+ // Hyphenate text
94
+ const text = "გამარჯობა, საქართველო მშვენიერი ქვეყანაა!";
95
+ console.log(hyphenator.hyphenateText(text));
96
+ // Output: "გა-მარ-ჯო-ბა, სა-ქარ-თვე-ლო მშვე-ნი-ე-რი ქვე-ყა-ნა-ა!"
97
+ ```
64
98
 
65
- * **V-CC-V:** სისტემა ამოწმებს თანხმოვნების ტიპს:
66
- * **Double Consonants**: თუ გვერდიგვერდ ერთი და იგივე თანხმოვანია, იყოფა მათ შორის (იშვიათია ქართულში).
67
- * **Harmonic Clusters**: თუ თანხმოვნები ქმნიან ჰარმონიულ წყვილს (მაგ: `ბრ`, `წვ`), ისინი რჩებიან ერთად და მარცვალი წყდება მათ წინ.
68
- * **Default**: სხვა შემთხვევაში იყოფა პირველი თანხმოვნის შემდეგ.
99
+ ---
69
100
 
101
+ ### Node.js (CommonJS)
102
+ ```javascript
103
+ const GeorgianHyphenator = require('georgian-hyphenation');
70
104
 
105
+ const hyphenator = new GeorgianHyphenator('-');
106
+ console.log(hyphenator.hyphenate('საქართველო'));
107
+ ```
71
108
 
72
- ### 3. უსაფრთხოების წესები (Constraints)
109
+ ---
73
110
 
74
- * **Anti-Orphan**: მარცვალი არასდროს წყდება ისე, რომ რომელიმე მხარეს დარჩეს მხოლოდ 1 ასო.
75
- * **Left/Right Min**: დამარცვლა ხდება მხოლოდ მაშინ, თუ ორივე მხარეს მინიმუმ 2 სიმბოლო რჩება (მაგ: `არა` არ დაიყოფა).
111
+ ## 📖 API Reference
76
112
 
77
- ### მაგალითების ანალიზი:
113
+ ### **Constructor**
114
+ ```javascript
115
+ new GeorgianHyphenator(hyphenChar = '\u00AD')
116
+ ```
78
117
 
79
- | სიტყვა | ანალიზი (ხმოვნებს შორის) | შედეგი | წესი |
80
- | --- | --- | --- | --- |
81
- | **საქართველო** | `ა-ქ-რ-ე` (2 თანხმოვანი) | `სა-ქარ-თვე-ლო` | სტანდარტული |
82
- | **ბარბი** | `ა-რ-ბ-ი` ('' წესი) | `ბარ-ბი` | სპეციალური 'რ' წესი |
83
- | **მწვრთნელი** | `მ-წ-ვ-რ-თ-ნ-ე` | `მწვრთნე-ლი` | ჰარმონიული ჯგუფი |
84
- | **გაანალიზება** | `ა-ა` (0 თანხმოვანი) | `გა-ა-ნა-ლი-ზე-ბა` | ხმოვანთშერწყმა |
118
+ **Parameters:**
119
+ - `hyphenChar` (string): Character to use for hyphenation
120
+ - `'\u00AD'` - Soft hyphen (invisible, default)
121
+ - `'-'` - Regular hyphen (visible)
122
+ - `'·'` - Middle dot
123
+ - Any custom character
85
124
 
86
125
  ---
87
126
 
88
- ## 📦 Installation / ინსტალაცია
127
+ ### **Methods**
89
128
 
90
- ### Python
129
+ #### `hyphenate(word)`
91
130
 
92
- ```bash
93
- pip install georgian-hyphenation
131
+ Hyphenates a single Georgian word.
94
132
 
133
+ **Features:**
134
+ - Automatically strips existing hyphens (sanitization)
135
+ - Checks dictionary first (if loaded)
136
+ - Falls back to algorithm
137
+ ```javascript
138
+ hyphenator.hyphenate('საქართველო'); // → "სა-ქარ-თვე-ლო"
139
+ hyphenator.hyphenate('ბლოკი'); // → "ბლო-კი" (harmonic cluster)
95
140
  ```
96
141
 
97
- ### JavaScript (NPM)
142
+ ---
98
143
 
99
- ```bash
100
- npm install georgian-hyphenation
144
+ #### `hyphenateText(text)`
101
145
 
146
+ Hyphenates entire text while preserving:
147
+ - Punctuation
148
+ - Numbers
149
+ - Latin characters
150
+ - Whitespace
151
+ ```javascript
152
+ const text = "საქართველო არის ლამაზი ქვეყანა.";
153
+ hyphenator.hyphenateText(text);
154
+ // → "სა-ქარ-თვე-ლო არის ლა-მა-ზი ქვე-ყა-ნა."
102
155
  ```
103
156
 
104
- ### Browser Extension
157
+ ---
105
158
 
106
- **🦊 Firefox:** [Install from Firefox Add-ons](https://addons.mozilla.org/firefox/addon/georgian-hyphenation/)
159
+ #### `getSyllables(word)`
107
160
 
108
- **🌐 Chrome:** *Coming soon to Chrome Web Store*
161
+ Returns syllables as an array.
162
+ ```javascript
163
+ hyphenator.getSyllables('საქართველო');
164
+ // → ['სა', 'ქარ', 'თვე', 'ლო']
165
+ ```
109
166
 
110
167
  ---
111
168
 
112
- ## 📚 Documentation / დოკუმენტაცია
169
+ #### `loadDefaultLibrary()` (Async)
113
170
 
114
- ### Python API
171
+ Loads the default exception dictionary (150+ words).
115
172
 
116
- ```python
117
- from georgian_hyphenation import GeorgianHyphenator
173
+ **Browser:** Fetches from CDN (`jsdelivr`)
174
+ **Node.js:** Loads from local `data/exceptions.json`
175
+ ```javascript
176
+ await hyphenator.loadDefaultLibrary();
177
+ console.log('Dictionary loaded!');
178
+ ```
118
179
 
119
- # Initialize with soft hyphen (default: U+00AD)
120
- hyphenator = GeorgianHyphenator()
180
+ ---
121
181
 
122
- # Hyphenate a word
123
- word = "საქართველო"
124
- result = hyphenator.hyphenate(word)
125
- print(result) # სა­ქარ­თვე­ლო (with U+00AD soft hyphens)
182
+ #### `loadLibrary(data)`
126
183
 
127
- # Get syllables as a list
128
- syllables = hyphenator.get_syllables(word)
129
- print(syllables) # ['სა', 'ქარ', 'თვე', 'ლო']
184
+ Load custom dictionary.
185
+ ```javascript
186
+ hyphenator.loadLibrary({
187
+ 'სპეციალური': 'სპე-ცი-ა-ლუ-რი',
188
+ 'კომპიუტერი': 'კომ-პიუ-ტე-რი'
189
+ });
190
+ ```
130
191
 
131
- # Use visible hyphens for display
132
- visible = GeorgianHyphenator('-')
133
- print(visible.hyphenate(word)) # სა-ქარ-თვე-ლო
192
+ ---
193
+
194
+ ## 🧠 Algorithm Logic
134
195
 
135
- # Hyphenate entire text (preserves punctuation)
136
- text = "საქართველო არის ლამაზი ქვეყანა."
137
- print(hyphenator.hyphenate_text(text))
138
- # Output: სა­ქარ­თვე­ლო არის ლა­მა­ზი ქვე­ყა­ნა.
196
+ The v2.2 algorithm uses **phonological distance analysis** with these rules:
139
197
 
198
+ ### 1. **Vowel Distance Analysis**
199
+ ```
200
+ საქართველო → vowels at: [1, 3, 5, 7]
140
201
  ```
141
202
 
142
- ---
203
+ ### 2. **Consonant Cluster Rules**
143
204
 
144
- ## 📚 JavaScript API (v2.2.1+)
205
+ - **V-V (0 consonants)**: Split between vowels
206
+ ```javascript
207
+ 'გააკეთა' → 'გა-ა-კე-თა'
208
+ ```
145
209
 
146
- v2.2.1 ვერსია სრულად გადასულია **ES Modules (ESM)** სტანდარტზე, რაც უზრუნველყოფს საუკეთესო თავსებადობას თანამედროვე ხელსაწყოებთან (Vite, React, Vue, Next.js) და Node.js-ის ახალ ვერსიებთან.
210
+ - **V-C-V (1 consonant)**: Split after first vowel
211
+ ```javascript
212
+ 'მამა' → 'მა-მა'
213
+ ```
147
214
 
148
- ### ⚙️ ინიციალიზაცია
215
+ - **V-CC-V (2+ consonants)**:
216
+ 1. Check for double consonants (gemination) - rare in Georgian
217
+ 2. Check for harmonic clusters (ბლ, გლ, კრ, etc.) - keep together
218
+ 3. Default: split after first consonant
149
219
 
150
- ```javascript
151
- import GeorgianHyphenator from 'georgian-hyphenation';
220
+ ### 3. **Harmonic Clusters (62 clusters)**
152
221
 
153
- // ნაგულისხმევი სიმბოლოა Soft-Hyphen (\u00AD)
154
- const hyphenator = new GeorgianHyphenator();
222
+ These consonant pairs stay together:
223
+ ```
224
+ ბლ, ბრ, ბღ, ბზ, გდ, გლ, გმ, გნ, გვ, გზ, გრ, დრ, თლ, თრ, თღ,
225
+ კლ, კმ, კნ, კრ, კვ, მტ, პლ, პრ, ჟღ, რგ, რლ, რმ, სწ, სხ, ტკ,
226
+ ტპ, ტრ, ფლ, ფრ, ფქ, ფშ, ქლ, ქნ, ქვ, ქრ, ღლ, ღრ, ყლ, ყრ, შთ,
227
+ შპ, ჩქ, ჩრ, ცლ, ცნ, ცრ, ცვ, ძგ, ძვ, ძღ, წლ, წრ, წნ, წკ, ჭკ,
228
+ ჭრ, ჭყ, ხლ, ხმ, ხნ, ხვ, ჯგ
229
+ ```
155
230
 
156
- // ტესტირებისთვის შეგიძლიათ გამოიყენოთ ხილული ტირე (-)
157
- const visibleHyphenator = new GeorgianHyphenator('-');
231
+ ### 4. **Anti-Orphan Protection**
158
232
 
233
+ Minimum 2 characters on each side:
234
+ ```javascript
235
+ 'არა' → 'არა' // Not split (would create 1-letter syllable)
236
+ 'არაა' → 'ა-რა-ა' // OK to split
159
237
  ```
160
238
 
161
- ### 🛠 ძირითადი მეთოდები
239
+ ---
162
240
 
163
- #### 1. `hyphenate(word)`
241
+ ## 🎨 Examples
164
242
 
243
+ ### Basic Words
165
244
  ```javascript
166
- const result = hyphenator.hyphenate('საქართველო');
167
- console.log(result); // "სა-ქარ-თვე-ლო"
245
+ hyphenate('საქართველო') // → სა-ქარ-თვე-ლო
246
+ hyphenate('მთავრობა') // → მთავ-რო-ბა
247
+ hyphenate('დედაქალაქი') // → დე-და-ქა-ლა-ქი
248
+ hyphenate('პარლამენტი') // → პარ-ლა-მენ-ტი
249
+ ```
168
250
 
251
+ ### Harmonic Clusters
252
+ ```javascript
253
+ hyphenate('ბლოკი') // → ბლო-კი (ბლ stays together)
254
+ hyphenate('კრემი') // → კრე-მი (კრ stays together)
255
+ hyphenate('გლეხი') // → გლე-ხი (გლ stays together)
256
+ hyphenate('პროგრამა') // → პროგ-რა-მა (პრ and გრ preserved)
169
257
  ```
170
258
 
171
- #### 2. `hyphenateText(text)`
259
+ ### V-V Split
260
+ ```javascript
261
+ hyphenate('გააკეთა') // → გა-ა-კე-თა
262
+ hyphenate('გაიარა') // → გა-ი-ა-რა
263
+ hyphenate('გაანალიზა') // → გა-ა-ნა-ლი-ზა
264
+ ```
172
265
 
266
+ ### Text Processing
173
267
  ```javascript
174
- const longText = "გამარჯობა, საქართველო მშვენიერი ქვეყანაა!";
175
- console.log(hyphenator.hyphenateText(longText));
268
+ hyphenateText('საქართველო არის ლამაზი ქვეყანა')
269
+ // → 'სა­ქარ­თვე­ლო არის ლა­მა­ზი ქვე­ყა­ნა' (with soft hyphens)
176
270
 
271
+ // Preserves punctuation
272
+ hyphenateText('მთავრობა, პარლამენტი და სასამართლო.')
273
+ // → 'მთავ­რო­ბა, პარ­ლა­მენ­ტი და სა­სა­მარ­თლო.'
177
274
  ```
178
275
 
179
- #### 3. `getSyllables(word)`
276
+ ---
180
277
 
181
- ```javascript
182
- const syllables = hyphenator.getSyllables('უნივერსიტეტი');
183
- console.log(syllables); // ["უ", "ნი", "ვერ", "სი", "ტე", "ტი"]
278
+ ## 🧪 Testing
184
279
 
280
+ Run the test suite:
281
+ ```bash
282
+ npm test
185
283
  ```
186
284
 
187
- #### 4. `loadDefaultLibrary()` (Async)
285
+ Expected output:
286
+ ```
287
+ ✅ Test 1: საქართველო → სა-ქარ-თვე-ლო
288
+ ✅ Test 2: მთავრობა → მთავ-რო-ბა
289
+ ...
290
+ 📊 Test Results: 13 passed, 0 failed
291
+ 🎉 All tests passed!
292
+ ```
188
293
 
189
- ```javascript
190
- await hyphenator.loadDefaultLibrary();
191
- console.log('ლექსიკონი ჩაიტვირთა');
294
+ ---
192
295
 
296
+ ## 📊 Dictionary
297
+
298
+ The library includes `data/exceptions.json` with 150+ Georgian words:
299
+ ```json
300
+ {
301
+ "საქართველო": "სა-ქარ-თვე-ლო",
302
+ "კომპიუტერი": "კომ-პიუ-ტე-რი",
303
+ "პროგრამა": "პროგ-რა-მა",
304
+ "ინტერნეტი": "ინ-ტერ-ნე-ტი"
305
+ }
193
306
  ```
194
307
 
195
308
  ---
196
309
 
197
- ## 🌐 Browser Usage (CDN / ESM)
310
+ ## 📝 Changelog
198
311
 
199
- ```html
200
- <p class="hyphenated" id="content"></p>
312
+ ### Version 2.2.4 (2026-01-27)
201
313
 
202
- <script type="module">
203
- import GeorgianHyphenator from 'https://cdn.jsdelivr.net/npm/georgian-hyphenation@2.2.2/src/javascript/index.js';
314
+ * 🌐 **Browser Fix**: Fixed CDN URL for reliable dictionary loading
315
+ * 📦 **NPM Files**: Added `data/` folder to published package (`files` whitelist)
316
+ * 🔧 **Error Handling**: Improved fallback when dictionary unavailable
317
+ * 📝 **Documentation**: Corrected examples, removed non-existent words
204
318
 
205
- async function initializeHyphenator() {
206
- const hyphenator = new GeorgianHyphenator('\u00AD');
207
- await hyphenator.loadDefaultLibrary();
319
+ ### Version 2.2.1 (2026-01-26)
208
320
 
209
- const text = "საქართველო არის ძალიან ლამაზი ქვეყანა, სადაც ბევრი ისტორიული ძეგლია.";
210
-
211
- document.getElementById('content').textContent = hyphenator.hyphenateText(text);
212
- }
321
+ * 🧹 **Sanitization**: Added `_stripHyphens` for automatic input cleaning
322
+ * ⚡ **Performance**: Converted `harmonicClusters` to `Set` (O(1) lookup)
323
+ * 📦 **ESM**: Full ES Modules support
324
+ * 📚 **Dictionary**: Added `loadDefaultLibrary()` method
213
325
 
214
- initializeHyphenator();
215
- </script>
326
+ ### Version 2.0.1 (2026-01-22)
216
327
 
217
- ```
328
+ * 🎓 **Academic Rewrite**: Phonological distance analysis
329
+ * 🛡️ **Anti-Orphan**: Minimum 2 characters on each side
330
+ * 🎼 **Harmonic Clusters**: Georgian-specific consonant groups
218
331
 
219
332
  ---
220
333
 
221
- ## 📊 Examples / მაგალითები
334
+ ## 🤝 Contributing
222
335
 
223
- | Word (სიტყვა) | Syllables (მარცვლები) | Hyphenated | TeX Pattern |
224
- | --- | --- | --- | --- |
225
- | საქართველო | სა, ქარ, თვე, ლო | სა-ქარ-თვე-ლო | .სა1ქარ1თვე1ლო. |
226
- | მთავრობა | მთავ, რო, ბა | მთავ-რო-ბა | .მთავ1რო1ბა. |
227
- | დედაქალაქი | დე, და, ქა, ლა, ქი | დე-და-ქა-ლა-ქი | .დე1და1ქა1ლა1ქი. |
228
- | ბლოკი | ბლო, კი | ბლო-კი | .ბლო1კი. |
229
- | კრემი | კრე, მი | კრე-მი | .კრე1მი. |
336
+ Contributions welcome! Please:
230
337
 
231
- ---
338
+ 1. Fork the repository
339
+ 2. Create a feature branch
340
+ 3. Run tests: `npm test`
341
+ 4. Submit a Pull Request
232
342
 
233
- ## 📝 Changelog
343
+ ---
234
344
 
235
- ### Version 2.2.2 (2025-01-27) — Documentation Update 📝
345
+ ## 🐛 Bug Reports
236
346
 
237
- * 📝 **README Corrections**: გამოსწორდა არასწორი მაგალითები (მაგ: "კლასსი" → წაშლილია, რადგან არ არსებობს ქართულში).
238
- * 📚 **Python README**: განახლდა Python package-ის README სრული დოკუმენტაციით და გასწორებული მაგალითებით.
239
- * ✅ **PyPI v2.2.2**: ხელახლა გამოქვეყნდა PyPI-ზე გასწორებული დოკუმენტაციით.
347
+ Found a bug? [Open an issue](https://github.com/guramzhgamadze/georgian-hyphenation/issues)
240
348
 
241
349
  ---
242
350
 
243
- ### Version 2.2.1 (2025-01-26) — The Modernization Update 🚀
351
+ ## 📄 License
244
352
 
245
- * 🧹 **Automatic Sanitization**: დაემატა `_stripHyphens` ფუნქციონალი, რომელიც ავტომატურად ასუფთავებს ტექსტს ძველი დამარცვლის სიმბოლოებისგან.
246
- * 📦 **ES Modules (ESM)**: ბიბლიოთეკა სრულად გადავიდა თანამედროვე JavaScript სტანდარტზე (`import/export`).
247
- * 📚 **Async Dictionary Support**: დაემატა `loadDefaultLibrary()` მეთოდი გამონაკლისების ლექსიკონის ავტომატური ჩატვირთვისთვის.
248
- * ⚡ **Optimization**: ჰარმონიული ჯგუფების ძებნა გადავიდა `Set` სტრუქტურაზე სისწრაფისთვის.
249
- * 🛠 **Package Improvements**: განახლდა `package.json` კონფიგურაცია (`exports`, `files` whitelist) NPM-ისთვის.
353
+ MIT License
250
354
 
251
- ---
355
+ Copyright (c) 2025 Guram Zhgamadze
356
+
357
+ Permission is hereby granted, free of charge, to any person obtaining a copy
358
+ of this software and associated documentation files (the "Software"), to deal
359
+ in the Software without restriction, including without limitation the rights
360
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
361
+ copies of the Software, and to permit persons to whom the Software is
362
+ furnished to do so, subject to the following conditions:
252
363
 
253
- ## 📄 License / ლიცენზია
364
+ The above copyright notice and this permission notice shall be included in all
365
+ copies or substantial portions of the Software.
254
366
 
255
- This project is licensed under the MIT License - see the LICENSE file for details.
367
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
368
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
369
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
370
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
371
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
372
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
373
+ SOFTWARE.
256
374
 
257
375
  ---
258
376
 
259
- ## 📧 Contact / კონტაქტი
377
+ ## 📧 Contact
260
378
 
261
379
  **Guram Zhgamadze**
262
380
 
263
- * 🐙 GitHub: [@guramzhgamadze](https://github.com/guramzhgamadze)
264
- * 📧 Email: guramzhgamadze@gmail.com
265
- * 🐛 Issues: [Report bugs or request features](https://github.com/guramzhgamadze/georgian-hyphenation/issues)
381
+ - 🐙 GitHub: [@guramzhgamadze](https://github.com/guramzhgamadze)
382
+ - 📧 Email: guramzhgamadze@gmail.com
383
+ - 📦 NPM: [georgian-hyphenation](https://www.npmjs.com/package/georgian-hyphenation)
266
384
 
267
385
  ---
268
386
 
269
- ## 🔗 Links / ლინკები
387
+ ## 🔗 Links
270
388
 
271
- * 🐍 **PyPI:** [https://pypi.org/project/georgian-hyphenation/](https://pypi.org/project/georgian-hyphenation/)
272
- * 📦 **NPM:** [https://www.npmjs.com/package/georgian-hyphenation](https://www.npmjs.com/package/georgian-hyphenation)
273
- * 🦊 **Firefox:** [https://addons.mozilla.org/firefox/addon/georgian-hyphenation/](https://addons.mozilla.org/firefox/addon/georgian-hyphenation/)
274
- * 🎨 **Demo:** [https://guramzhgamadze.github.io/georgian-hyphenation/](https://guramzhgamadze.github.io/georgian-hyphenation/)
389
+ - **NPM Package:** https://www.npmjs.com/package/georgian-hyphenation
390
+ - **GitHub Repository:** https://github.com/guramzhgamadze/georgian-hyphenation
391
+ - **Demo:** https://guramzhgamadze.github.io/georgian-hyphenation/
392
+ - **PyPI (Python):** https://pypi.org/project/georgian-hyphenation/
275
393
 
276
394
  ---
277
395
 
278
- Made with ❤️ for the Georgian language community
279
-
280
- შექმნილია ❤️-ით ქართული ენის საზოგადოებისთვის
281
-
282
- 🇬🇪 **საქართველო** 🇬🇪
396
+ **Made with ❤️ for the Georgian language community**
283
397
 
284
- ---
398
+ 🇬🇪 **ქართული ენის ციფრული განვითარებისთვის**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "georgian-hyphenation",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "Georgian Language Hyphenation Library - Browser + Node.js compatible",
5
5
  "main": "src/javascript/index.js",
6
6
  "module": "src/javascript/index.js",
@@ -13,7 +13,7 @@
13
13
  "./data/exceptions.json": "./data/exceptions.json"
14
14
  },
15
15
  "files": [
16
- "src/",
16
+ "src/javascript/",
17
17
  "data/",
18
18
  "README.md",
19
19
  "LICENSE"
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Georgian Hyphenation Library v2.2.3
2
+ * Georgian Hyphenation Library v2.2.4
3
3
  * Browser + Node.js Compatible
4
4
  */
5
5
 
@@ -54,7 +54,7 @@ export default class GeorgianHyphenator {
54
54
  if (typeof window !== 'undefined' && typeof fetch !== 'undefined') {
55
55
  try {
56
56
  // ✅ სწორი CDN URL - jsdelivr უფრო სანდოა unpkg-ზე
57
- const response = await fetch('https://cdn.jsdelivr.net/npm/georgian-hyphenation@2.2.3/data/exceptions.json');
57
+ const response = await fetch('https://cdn.jsdelivr.net/npm/georgian-hyphenation@2.2.4/data/exceptions.json');
58
58
 
59
59
  if (!response.ok) {
60
60
  throw new Error(`HTTP ${response.status}`);
@@ -64,9 +64,9 @@ export default class GeorgianHyphenator {
64
64
  this.loadLibrary(data);
65
65
  this.dictionaryLoaded = true;
66
66
 
67
- console.log(`Georgian Hyphenation v2.2.3: Dictionary loaded (${this.dictionary.size} words)`);
67
+ console.log(`Georgian Hyphenation v2.2.4: Dictionary loaded (${this.dictionary.size} words)`);
68
68
  } catch (error) {
69
- console.warn('Georgian Hyphenation v2.2.3: Dictionary not available, using algorithm only');
69
+ console.warn('Georgian Hyphenation v2.2.4: Dictionary not available, using algorithm only');
70
70
  console.warn('Error:', error.message);
71
71
  }
72
72
  }
@@ -77,9 +77,9 @@ export default class GeorgianHyphenator {
77
77
  const data = require('../../data/exceptions.json');
78
78
  this.loadLibrary(data);
79
79
  this.dictionaryLoaded = true;
80
- console.log(`Georgian Hyphenation v2.2.3: Dictionary loaded (${this.dictionary.size} words)`);
80
+ console.log(`Georgian Hyphenation v2.2.4: Dictionary loaded (${this.dictionary.size} words)`);
81
81
  } catch (error) {
82
- console.warn('Georgian Hyphenation v2.2.3: Local dictionary not found, using algorithm only');
82
+ console.warn('Georgian Hyphenation v2.2.4: Local dictionary not found, using algorithm only');
83
83
  }
84
84
  }
85
85
  }