uchcharan 0.1.0 → 0.2.2

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.
Files changed (3) hide show
  1. package/README.md +24 -1
  2. package/package.json +32 -6
  3. package/src/rules.js +1 -1
package/README.md CHANGED
@@ -79,7 +79,7 @@ echo "PNR 4521879630" | npx uchcharan --explain
79
79
 
80
80
  ## Roadmap
81
81
 
82
- - [ ] Hosted HTTP API with a free tier
82
+ - [x] Hosted HTTP API with a free tier: **https://uchcharan.dev**
83
83
  - [ ] Gujarati, Tamil, Telugu, Bengali, Kannada
84
84
  - [ ] Custom pronunciation dictionary for brand and place names (`Nashik`, `Paithani`)
85
85
  - [ ] Plugins for ElevenLabs, Sarvam, Bolna and LiveKit pipelines
@@ -87,6 +87,29 @@ echo "PNR 4521879630" | npx uchcharan --explain
87
87
 
88
88
  Contributions are welcome, especially from native speakers checking number words.
89
89
 
90
+ ## Hosted API (no setup)
91
+
92
+ Don't want to run it yourself? Use the hosted API at **https://uchcharan.dev**. Try it in the browser at https://huggingface.co/spaces/Densa850/uchcharan.
93
+
94
+ ```bash
95
+ curl -X POST https://uchcharan.dev/v1/normalize \
96
+ -H "content-type: application/json" -H "x-api-key: YOUR_KEY" \
97
+ -d '{"text":"₹2.5 crore, PNR 4521879630","lang":"hi"}'
98
+ ```
99
+
100
+ | Plan | Requests/day | Price |
101
+ |---|---|---|
102
+ | No key | 500 | free |
103
+ | Free key | 2,000 | free |
104
+ | Starter | 50,000 | ₹999/month |
105
+ | Pro | 500,000 + custom pronunciations | ₹4,999/month |
106
+
107
+ Get a free key or upgrade at **https://uchcharan.dev**. Need help adding it to your voice bot? Email support@tathyo.com.
108
+
109
+ ## Support this project
110
+
111
+ If uchcharan saves you time, you can [sponsor its development on GitHub](https://github.com/sponsors/densa850-lab). Sponsorship pays for new languages and rules.
112
+
90
113
  ## License
91
114
 
92
115
  MIT
package/package.json CHANGED
@@ -1,17 +1,43 @@
1
1
  {
2
2
  "name": "uchcharan",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "Make any TTS speak Indian text correctly. Normalizes ₹ amounts, lakh/crore, dates, times, phone numbers, PNR/OTP, %, units and acronyms into spoken Hindi and Marathi.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "exports": "./src/index.js",
8
- "bin": { "uchcharan": "bin/uchcharan.js" },
9
- "files": ["src", "bin", "README.md", "LICENSE"],
8
+ "bin": {
9
+ "uchcharan": "bin/uchcharan.js"
10
+ },
11
+ "files": [
12
+ "src",
13
+ "bin",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
10
17
  "scripts": {
11
18
  "test": "node --test",
12
19
  "demo": "node examples/demo.js"
13
20
  },
14
- "engines": { "node": ">=18" },
15
- "keywords": ["tts", "text-normalization", "hindi", "marathi", "indic", "voice-ai", "speech", "elevenlabs", "sarvam", "ivr"],
16
- "license": "MIT"
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "keywords": [
25
+ "tts",
26
+ "text-normalization",
27
+ "hindi",
28
+ "marathi",
29
+ "indic",
30
+ "voice-ai",
31
+ "speech",
32
+ "elevenlabs",
33
+ "sarvam",
34
+ "ivr"
35
+ ],
36
+ "license": "MIT",
37
+ "homepage": "https://uchcharan.dev",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/densa850-lab/uchcharan.git"
41
+ },
42
+ "funding": "https://github.com/sponsors/densa850-lab"
17
43
  }
package/src/rules.js CHANGED
@@ -4,7 +4,7 @@ import { intToWords, digitsToWords, numberStringToWords, yearToWords, amountWord
4
4
 
5
5
  // Number with Western (1,500,000) or Indian (15,00,000) commas, optional decimals.
6
6
  const NUM = String.raw`(?:\d{1,3}(?:,\d{3})+(?!\d)|\d{1,2}(?:,\d{2})+,\d{3}(?!\d)|\d+)(?:\.\d+)?`;
7
- const DEV = String.raw`ऀ-ॿ`;
7
+ const DEV = String.raw`\u0900-\u097F`;
8
8
  const MONTHS = String.raw`Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:t(?:ember)?)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?`;
9
9
  const MONTH_KEYS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
10
10