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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gpl-3.0
|
| 3 |
+
tags:
|
| 4 |
+
- translation
|
| 5 |
+
- spanish
|
| 6 |
+
- english
|
| 7 |
+
- offline
|
| 8 |
+
- on-device
|
| 9 |
+
- dictionary
|
| 10 |
+
- idioms
|
| 11 |
+
- phrases
|
| 12 |
+
- rule-based
|
| 13 |
+
- ios
|
| 14 |
+
- mobile
|
| 15 |
+
- no-cloud
|
| 16 |
+
language:
|
| 17 |
+
- es
|
| 18 |
+
- en
|
| 19 |
+
task_categories:
|
| 20 |
+
- translation
|
| 21 |
+
size_categories:
|
| 22 |
+
- 100K<n<1M
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# Spanish-English Offline Translation Dictionary
|
| 26 |
+
|
| 27 |
+
A **268,622-entry** Spanish→English lookup dictionary with **6,056 idiomatic phrases** and translation rules — built for **offline, on-device** mobile use. No API calls, no cloud, no internet required.
|
| 28 |
+
|
| 29 |
+
This is the production dictionary shipped inside [**RealTime AI Camera**](https://apps.apple.com/us/app/realtime-ai-cam/id6751230739), powering the app's offline Spanish→English translation feature.
|
| 30 |
+
|
| 31 |
+
## Why this exists
|
| 32 |
+
|
| 33 |
+
Most Spanish-English translation resources on the Hub are training datasets for seq2seq models. This is different — it's a **lookup dictionary** designed for **rule-based translation on a phone**:
|
| 34 |
+
|
| 35 |
+
- Runs in pure code (Swift, Python, JS — anything that reads JSON). No model inference, no GPU, no neural network.
|
| 36 |
+
- Sub-millisecond lookups. Key-value, not beam search.
|
| 37 |
+
- 4 MB compressed. Ships inside an iOS app binary without inflating the download.
|
| 38 |
+
- Works in airplane mode, in a basement, in a national park with no signal.
|
| 39 |
+
- Includes idiomatic phrases that word-by-word translation gets wrong ("a hurtadillas" → "stealthily", not "to little stolen things").
|
| 40 |
+
|
| 41 |
+
If you need a lightweight, offline Spanish↔English dictionary for a mobile app, embedded device, or edge deployment — this is it.
|
| 42 |
+
|
| 43 |
+
## Contents
|
| 44 |
+
|
| 45 |
+
Single file: `es_final_with_rules.json.gz` (4.2 MB compressed, ~25 MB uncompressed)
|
| 46 |
+
|
| 47 |
+
```json
|
| 48 |
+
{
|
| 49 |
+
"version": "3.1-merged",
|
| 50 |
+
"generated": "2025-09-02T05:14:26Z",
|
| 51 |
+
"dictionary": { ... }, // 268,622 entries
|
| 52 |
+
"phrases": { ... }, // 6,056 idiomatic phrases
|
| 53 |
+
"rules": { ... } // 10 categories of translation guidelines
|
| 54 |
+
}
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
### Dictionary — 268,622 entries
|
| 58 |
+
|
| 59 |
+
Each entry maps a Spanish string to an English translation with an optional part-of-speech tag:
|
| 60 |
+
|
| 61 |
+
```json
|
| 62 |
+
{
|
| 63 |
+
"abandonar": { "translation": "to abandon", "pos": "VERB" },
|
| 64 |
+
"abogado": { "translation": "lawyer", "pos": "NOUN" },
|
| 65 |
+
"a decir verdad, esto es un poco demasiado picante para mi.": {
|
| 66 |
+
"translation": "to tell you the truth, this is a little too spicy for me.",
|
| 67 |
+
"pos": "UNKNOWN"
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Entries range from single words to full contextual sentences. Many entries include conjugated verb forms, common phrases with prepositions, and regional variations.
|
| 73 |
+
|
| 74 |
+
**Part-of-speech distribution:**
|
| 75 |
+
|
| 76 |
+
| POS | Count | Examples |
|
| 77 |
+
|---|---|---|
|
| 78 |
+
| UNKNOWN | 213,954 | Sentences, multi-word expressions, unlabeled entries |
|
| 79 |
+
| VERB | 22,299 | abandonar, abrir, aceptar |
|
| 80 |
+
| NOUN | 21,262 | abogado, agua, amigo |
|
| 81 |
+
| ADJ | 9,133 | alto, bueno, grande |
|
| 82 |
+
| ADV | 703 | además, bien, cerca |
|
| 83 |
+
| AUX | 336 | haber, ser, estar |
|
| 84 |
+
| PRON | 277 | yo, tú, él |
|
| 85 |
+
| INTJ | 214 | hola, oye, caramba |
|
| 86 |
+
| Other | 408 | DET, NUM, ADP, SCONJ, etc. |
|
| 87 |
+
|
| 88 |
+
### Phrases — 6,056 idiomatic expressions
|
| 89 |
+
|
| 90 |
+
Phrase-level translations that word-by-word lookup would get wrong:
|
| 91 |
+
|
| 92 |
+
```json
|
| 93 |
+
{
|
| 94 |
+
"a caballo regalado no le mires el diente": "don't look a gift horse in the mouth",
|
| 95 |
+
"a flor de piel": "skin-deep",
|
| 96 |
+
"a gatas": "on all fours",
|
| 97 |
+
"a grandes rasgos": "in broad strokes",
|
| 98 |
+
"a hurtadillas": "stealthily",
|
| 99 |
+
"dar en el clavo": "to hit the nail on the head",
|
| 100 |
+
"echar de menos": "to miss someone"
|
| 101 |
+
}
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
### Rules — translation guidelines
|
| 105 |
+
|
| 106 |
+
10 categories of structured translation rules including:
|
| 107 |
+
|
| 108 |
+
- **translationGuidelines** — general principles ("prioritize meaning over literalism; preserve tone and intent")
|
| 109 |
+
- **glossaryCore** — consistent translations for UI terms, technical vocabulary
|
| 110 |
+
- **Metadata** — provenance and schema versioning
|
| 111 |
+
|
| 112 |
+
## Usage
|
| 113 |
+
|
| 114 |
+
### Python
|
| 115 |
+
|
| 116 |
+
```python
|
| 117 |
+
import gzip
|
| 118 |
+
import json
|
| 119 |
+
|
| 120 |
+
with gzip.open("es_final_with_rules.json.gz", "rt", encoding="utf-8") as f:
|
| 121 |
+
data = json.load(f)
|
| 122 |
+
|
| 123 |
+
dictionary = data["dictionary"]
|
| 124 |
+
phrases = data["phrases"]
|
| 125 |
+
|
| 126 |
+
# Word lookup
|
| 127 |
+
entry = dictionary.get("abogado")
|
| 128 |
+
if entry:
|
| 129 |
+
print(entry["translation"]) # "lawyer"
|
| 130 |
+
|
| 131 |
+
# Phrase lookup (check phrases first, fall back to dictionary)
|
| 132 |
+
text = "a hurtadillas"
|
| 133 |
+
if text in phrases:
|
| 134 |
+
print(phrases[text]) # "stealthily"
|
| 135 |
+
elif text in dictionary:
|
| 136 |
+
print(dictionary[text]["translation"])
|
| 137 |
+
```
|
| 138 |
+
|
| 139 |
+
### Swift (iOS / macOS)
|
| 140 |
+
|
| 141 |
+
```swift
|
| 142 |
+
import Foundation
|
| 143 |
+
|
| 144 |
+
guard let url = Bundle.main.url(forResource: "es_final_with_rules", withExtension: "json.gz"),
|
| 145 |
+
let compressed = try? Data(contentsOf: url),
|
| 146 |
+
let json = try? (compressed as NSData).decompressed(using: .zlib),
|
| 147 |
+
let dict = try? JSONSerialization.jsonObject(with: json) as? [String: Any],
|
| 148 |
+
let dictionary = dict["dictionary"] as? [String: [String: String]],
|
| 149 |
+
let phrases = dict["phrases"] as? [String: String]
|
| 150 |
+
else { return }
|
| 151 |
+
|
| 152 |
+
// Phrase lookup
|
| 153 |
+
if let translation = phrases["a hurtadillas"] {
|
| 154 |
+
print(translation) // "stealthily"
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
// Word lookup
|
| 158 |
+
if let entry = dictionary["abogado"], let translation = entry["translation"] {
|
| 159 |
+
print(translation) // "lawyer"
|
| 160 |
+
}
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
For the full production implementation with rule-based grammar, see [`SpanishTranslationEngine.swift`](https://github.com/nicedreamzapp/RealTimeAICam/blob/main/SpanishTranslationEngine.swift) in the RealTime AI Camera repo.
|
| 164 |
+
|
| 165 |
+
### JavaScript / Node.js
|
| 166 |
+
|
| 167 |
+
```javascript
|
| 168 |
+
const zlib = require("zlib");
|
| 169 |
+
const fs = require("fs");
|
| 170 |
+
|
| 171 |
+
const compressed = fs.readFileSync("es_final_with_rules.json.gz");
|
| 172 |
+
const data = JSON.parse(zlib.gunzipSync(compressed).toString());
|
| 173 |
+
|
| 174 |
+
const { dictionary, phrases } = data;
|
| 175 |
+
|
| 176 |
+
console.log(phrases["a hurtadillas"]); // "stealthily"
|
| 177 |
+
console.log(dictionary["abogado"].translation); // "lawyer"
|
| 178 |
+
```
|
| 179 |
+
|
| 180 |
+
## How it was built
|
| 181 |
+
|
| 182 |
+
The dictionary was compiled from multiple open sources, merged, deduplicated, and POS-tagged. Idiomatic phrases were curated separately — these are expressions where the whole is not the sum of the parts, so they need dedicated entries. Translation rules were structured to guide consistent output in a rule-based engine (no neural model needed).
|
| 183 |
+
|
| 184 |
+
The goal was a dictionary that's:
|
| 185 |
+
1. **Complete enough** for real-world camera OCR text (signs, menus, documents, labels)
|
| 186 |
+
2. **Small enough** to ship inside an iOS app (4 MB compressed)
|
| 187 |
+
3. **Fast enough** for real-time use (key-value lookup, not inference)
|
| 188 |
+
|
| 189 |
+
## License
|
| 190 |
+
|
| 191 |
+
**GPL-3.0** — same as the parent project [RealTime AI Camera](https://github.com/nicedreamzapp/RealTimeAICam).
|
| 192 |
+
|
| 193 |
+
Commercial licensing available — contact **Matt Macosko** via [nicedreamzwholesale.com](https://nicedreamzwholesale.com/github-realtime-ai-camera/).
|
| 194 |
+
|
| 195 |
+
## Links
|
| 196 |
+
|
| 197 |
+
- 📱 **App Store:** [RealTime AI Camera (free)](https://apps.apple.com/us/app/realtime-ai-cam/id6751230739)
|
| 198 |
+
- 💻 **Source code:** [github.com/nicedreamzapp/RealTimeAICam](https://github.com/nicedreamzapp/RealTimeAICam)
|
| 199 |
+
- 🌐 **Product page:** [NiceDreamzApps](https://nicedreamzwholesale.com/github-realtime-ai-camera/)
|
| 200 |
+
- 🤖 **YOLOv8 CoreML model:** [divinetribe/yolov8n-oiv7-coreml](https://huggingface.co/divinetribe/yolov8n-oiv7-coreml)
|
| 201 |
+
|
| 202 |
+
---
|
| 203 |
+
|
| 204 |
+
Built by [Matt Macosko / NiceDreamzApps](https://nicedreamzwholesale.com) · Offline-first · Privacy-first
|
es_final_with_rules.json.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb246e7ddb63b65b43c444db7130b65386d6e35fe793e05f5fe728673cf74e3f
|
| 3 |
+
size 4193125
|