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 +277 -163
- package/package.json +2 -2
- package/src/javascript/index.js +6 -6
- package/src/georgian_hyphenation/__init__.py +0 -26
- package/src/georgian_hyphenation/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/georgian_hyphenation/__pycache__/hyphenator.cpython-313.pyc +0 -0
- package/src/georgian_hyphenation/hyphenator.py +0 -358
- package/src/georgian_hyphenation/hyphenator.py.backup +0 -312
- package/src/georgian_hyphenation.egg-info/PKG-INFO +0 -657
- package/src/georgian_hyphenation.egg-info/SOURCES.txt +0 -14
- package/src/georgian_hyphenation.egg-info/dependency_links.txt +0 -1
- package/src/georgian_hyphenation.egg-info/requires.txt +0 -3
- package/src/georgian_hyphenation.egg-info/top_level.txt +0 -2
package/README.md
CHANGED
|
@@ -1,284 +1,398 @@
|
|
|
1
|
-
# Georgian Language Hyphenation
|
|
1
|
+
# Georgian Language Hyphenation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/georgian-hyphenation)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
|
|
6
|
+
[](https://www.npmjs.com/package/georgian-hyphenation)
|
|
4
7
|
|
|
5
|
-
|
|
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
|
-
## ✨
|
|
14
|
+
## ✨ New in v2.2.4
|
|
12
15
|
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
## ✨ Features from v2.2.2
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
## 📦 Installation
|
|
34
|
+
```bash
|
|
35
|
+
npm install georgian-hyphenation
|
|
36
|
+
```
|
|
45
37
|
|
|
46
|
-
|
|
38
|
+
---
|
|
47
39
|
|
|
48
|
-
|
|
40
|
+
## 🚀 Quick Start
|
|
49
41
|
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
78
|
+
---
|
|
54
79
|
|
|
55
|
-
|
|
80
|
+
### Node.js (ESM)
|
|
81
|
+
```javascript
|
|
82
|
+
import GeorgianHyphenator from 'georgian-hyphenation';
|
|
56
83
|
|
|
57
|
-
|
|
84
|
+
const hyphenator = new GeorgianHyphenator('-'); // Visible hyphen
|
|
58
85
|
|
|
59
|
-
|
|
86
|
+
// Hyphenate a word
|
|
87
|
+
console.log(hyphenator.hyphenate('საქართველო'));
|
|
88
|
+
// Output: "სა-ქარ-თვე-ლო"
|
|
60
89
|
|
|
61
|
-
|
|
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
|
-
|
|
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
|
-
|
|
109
|
+
---
|
|
73
110
|
|
|
74
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
127
|
+
### **Methods**
|
|
89
128
|
|
|
90
|
-
|
|
129
|
+
#### `hyphenate(word)`
|
|
91
130
|
|
|
92
|
-
|
|
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
|
-
|
|
142
|
+
---
|
|
98
143
|
|
|
99
|
-
|
|
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
|
-
|
|
157
|
+
---
|
|
105
158
|
|
|
106
|
-
|
|
159
|
+
#### `getSyllables(word)`
|
|
107
160
|
|
|
108
|
-
|
|
161
|
+
Returns syllables as an array.
|
|
162
|
+
```javascript
|
|
163
|
+
hyphenator.getSyllables('საქართველო');
|
|
164
|
+
// → ['სა', 'ქარ', 'თვე', 'ლო']
|
|
165
|
+
```
|
|
109
166
|
|
|
110
167
|
---
|
|
111
168
|
|
|
112
|
-
|
|
169
|
+
#### `loadDefaultLibrary()` (Async)
|
|
113
170
|
|
|
114
|
-
|
|
171
|
+
Loads the default exception dictionary (150+ words).
|
|
115
172
|
|
|
116
|
-
|
|
117
|
-
from
|
|
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
|
-
|
|
120
|
-
hyphenator = GeorgianHyphenator()
|
|
180
|
+
---
|
|
121
181
|
|
|
122
|
-
|
|
123
|
-
word = "საქართველო"
|
|
124
|
-
result = hyphenator.hyphenate(word)
|
|
125
|
-
print(result) # საქართველო (with U+00AD soft hyphens)
|
|
182
|
+
#### `loadLibrary(data)`
|
|
126
183
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
184
|
+
Load custom dictionary.
|
|
185
|
+
```javascript
|
|
186
|
+
hyphenator.loadLibrary({
|
|
187
|
+
'სპეციალური': 'სპე-ცი-ა-ლუ-რი',
|
|
188
|
+
'კომპიუტერი': 'კომ-პიუ-ტე-რი'
|
|
189
|
+
});
|
|
190
|
+
```
|
|
130
191
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🧠 Algorithm Logic
|
|
134
195
|
|
|
135
|
-
|
|
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
|
-
|
|
205
|
+
- **V-V (0 consonants)**: Split between vowels
|
|
206
|
+
```javascript
|
|
207
|
+
'გააკეთა' → 'გა-ა-კე-თა'
|
|
208
|
+
```
|
|
145
209
|
|
|
146
|
-
|
|
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
|
-
|
|
151
|
-
import GeorgianHyphenator from 'georgian-hyphenation';
|
|
220
|
+
### 3. **Harmonic Clusters (62 clusters)**
|
|
152
221
|
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
241
|
+
## 🎨 Examples
|
|
164
242
|
|
|
243
|
+
### Basic Words
|
|
165
244
|
```javascript
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
259
|
+
### V-V Split
|
|
260
|
+
```javascript
|
|
261
|
+
hyphenate('გააკეთა') // → გა-ა-კე-თა
|
|
262
|
+
hyphenate('გაიარა') // → გა-ი-ა-რა
|
|
263
|
+
hyphenate('გაანალიზა') // → გა-ა-ნა-ლი-ზა
|
|
264
|
+
```
|
|
172
265
|
|
|
266
|
+
### Text Processing
|
|
173
267
|
```javascript
|
|
174
|
-
|
|
175
|
-
|
|
268
|
+
hyphenateText('საქართველო არის ლამაზი ქვეყანა')
|
|
269
|
+
// → 'საქართველო არის ლამაზი ქვეყანა' (with soft hyphens)
|
|
176
270
|
|
|
271
|
+
// Preserves punctuation
|
|
272
|
+
hyphenateText('მთავრობა, პარლამენტი და სასამართლო.')
|
|
273
|
+
// → 'მთავრობა, პარლამენტი და სასამართლო.'
|
|
177
274
|
```
|
|
178
275
|
|
|
179
|
-
|
|
276
|
+
---
|
|
180
277
|
|
|
181
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
310
|
+
## 📝 Changelog
|
|
198
311
|
|
|
199
|
-
|
|
200
|
-
<p class="hyphenated" id="content"></p>
|
|
312
|
+
### Version 2.2.4 (2026-01-27)
|
|
201
313
|
|
|
202
|
-
|
|
203
|
-
|
|
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
|
-
|
|
206
|
-
const hyphenator = new GeorgianHyphenator('\u00AD');
|
|
207
|
-
await hyphenator.loadDefaultLibrary();
|
|
319
|
+
### Version 2.2.1 (2026-01-26)
|
|
208
320
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
334
|
+
## 🤝 Contributing
|
|
222
335
|
|
|
223
|
-
|
|
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
|
-
|
|
343
|
+
---
|
|
234
344
|
|
|
235
|
-
|
|
345
|
+
## 🐛 Bug Reports
|
|
236
346
|
|
|
237
|
-
|
|
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
|
-
|
|
351
|
+
## 📄 License
|
|
244
352
|
|
|
245
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
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
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
+
"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"
|
package/src/javascript/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Georgian Hyphenation Library v2.2.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
82
|
+
console.warn('Georgian Hyphenation v2.2.4: Local dictionary not found, using algorithm only');
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|