owais2580 commited on
Commit
7599e7a
·
verified ·
1 Parent(s): e78727c

translation of phoneme sequences to text sentences phoneme sequences are in text format and english language

Browse files
Files changed (2) hide show
  1. README.md +7 -4
  2. index.html +169 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Phonemeparser Pro
3
- emoji: 🐨
4
  colorFrom: red
5
- colorTo: blue
 
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: PhonemeParser Pro 🎤
 
3
  colorFrom: red
4
+ colorTo: yellow
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,170 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>PhonemeParser Pro - Convert Phonemes to Text</title>
7
+ <link rel="icon" type="image/x-icon" href="/static/favicon.ico">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://unpkg.com/feather-icons"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.waves.min.js"></script>
12
+ <style>
13
+ .phoneme-input {
14
+ font-family: 'Courier New', monospace;
15
+ letter-spacing: 1.5px;
16
+ }
17
+ .result-box {
18
+ min-height: 150px;
19
+ background-color: rgba(255, 255, 255, 0.1);
20
+ backdrop-filter: blur(5px);
21
+ }
22
+ </style>
23
+ </head>
24
+ <body class="bg-gradient-to-br from-indigo-900 to-purple-900 text-white min-h-screen">
25
+ <div id="vanta-bg" class="fixed inset-0 z-0"></div>
26
+ <div class="relative z-10 container mx-auto px-4 py-12">
27
+ <header class="text-center mb-12">
28
+ <h1 class="text-4xl md:text-5xl font-bold mb-4">PhonemeParser Pro <span class="text-yellow-300">🎤</span></h1>
29
+ <p class="text-lg text-indigo-200 max-w-2xl mx-auto">Transform phoneme sequences into readable English text with our intelligent converter</p>
30
+ </header>
31
+
32
+ <main class="max-w-4xl mx-auto">
33
+ <div class="bg-white/10 backdrop-blur-lg rounded-xl shadow-2xl overflow-hidden">
34
+ <div class="p-6 md:p-8">
35
+ <div class="mb-6">
36
+ <label for="phonemeInput" class="block text-sm font-medium text-indigo-100 mb-2">
37
+ Enter Phoneme Sequence <span class="text-xs text-indigo-300">(e.g., /hɛˈloʊ wɜːld/)</span>
38
+ </label>
39
+ <textarea
40
+ id="phonemeInput"
41
+ class="phoneme-input w-full px-4 py-3 rounded-lg bg-gray-900/50 border border-indigo-500 focus:ring-2 focus:ring-yellow-400 focus:border-transparent text-white transition-all duration-300"
42
+ rows="4"
43
+ placeholder="Paste your phoneme sequence here..."></textarea>
44
+ </div>
45
+
46
+ <div class="flex flex-col sm:flex-row gap-4 mb-6">
47
+ <button id="convertBtn" class="flex-1 bg-gradient-to-r from-yellow-400 to-yellow-500 hover:from-yellow-500 hover:to-yellow-600 text-gray-900 font-bold py-3 px-6 rounded-lg flex items-center justify-center transition-all duration-300 transform hover:scale-105">
48
+ <i data-feather="play" class="mr-2"></i> Convert to Text
49
+ </button>
50
+ <button id="clearBtn" class="flex-1 bg-gray-700 hover:bg-gray-600 text-white font-bold py-3 px-6 rounded-lg flex items-center justify-center transition-all duration-300">
51
+ <i data-feather="trash-2" class="mr-2"></i> Clear
52
+ </button>
53
+ </div>
54
+
55
+ <div class="mb-4">
56
+ <label class="block text-sm font-medium text-indigo-100 mb-2">Converted Text Result</label>
57
+ <div id="resultBox" class="result-box rounded-lg p-4 text-lg border-2 border-dashed border-indigo-400 transition-all duration-300">
58
+ <p class="text-center text-indigo-200">Your converted text will appear here...</p>
59
+ </div>
60
+ </div>
61
+
62
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-6">
63
+ <div class="bg-indigo-900/50 p-4 rounded-lg">
64
+ <h3 class="font-bold text-yellow-300 mb-3 flex items-center">
65
+ <i data-feather="info" class="mr-2"></i> Phoneme Examples
66
+ </h3>
67
+ <ul class="text-sm space-y-2">
68
+ <li><span class="font-mono">/hɛˈloʊ/</span> → "Hello"</li>
69
+ <li><span class="font-mono">/wɜːld/</span> → "World"</li>
70
+ <li><span class="font-mono">/ˈæpl/</span> → "Apple"</li>
71
+ <li><span class="font-mono">/kəmˈpjuːtər/</span> → "Computer"</li>
72
+ </ul>
73
+ </div>
74
+ <div class="bg-purple-900/50 p-4 rounded-lg">
75
+ <h3 class="font-bold text-yellow-300 mb-3 flex items-center">
76
+ <i data-feather="zap" class="mr-2"></i> Quick Tips
77
+ </h3>
78
+ <ul class="text-sm space-y-2">
79
+ <li>Use slashes / around phonemes</li>
80
+ <li>Separate words with spaces</li>
81
+ <li>Stress markers (ˈ) help pronunciation</li>
82
+ <li>For best results, use IPA phonemes</li>
83
+ </ul>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </main>
89
+
90
+ <footer class="mt-16 text-center text-indigo-300 text-sm">
91
+ <p>Built with ❤️ for linguists and language learners</p>
92
+ <p class="mt-2">© 2023 PhonemeParser Pro - All phonemes reserved</p>
93
+ </footer>
94
+ </div>
95
+
96
+ <script>
97
+ // Initialize Vanta.js background
98
+ VANTA.WAVES({
99
+ el: "#vanta-bg",
100
+ mouseControls: true,
101
+ touchControls: true,
102
+ gyroControls: false,
103
+ minHeight: 200.00,
104
+ minWidth: 200.00,
105
+ scale: 1.00,
106
+ scaleMobile: 1.00,
107
+ color: 0x4f46e5,
108
+ shininess: 35.00,
109
+ waveHeight: 15.00,
110
+ waveSpeed: 0.85,
111
+ zoom: 0.75
112
+ });
113
+
114
+ // Initialize feather icons
115
+ feather.replace();
116
+
117
+ // Sample phoneme mapping (in a real app, this would be more comprehensive)
118
+ const phonemeMap = {
119
+ "/hɛˈloʊ/": "Hello",
120
+ "/wɜːld/": "World",
121
+ "/ˈæpl/": "Apple",
122
+ "/kəmˈpjuːtər/": "Computer",
123
+ "/ˈhæpi/": "Happy",
124
+ "/bɝθˈdeɪ/": "Birthday",
125
+ "/θæŋk juː/": "Thank you",
126
+ "/ˈwʌndərfəl/": "Wonderful",
127
+ "/ˈlʌvli/": "Lovely",
128
+ "/ˈbeɪsɪk/": "Basic"
129
+ };
130
+
131
+ document.getElementById('convertBtn').addEventListener('click', function() {
132
+ const input = document.getElementById('phonemeInput').value.trim();
133
+ const resultBox = document.getElementById('resultBox');
134
+
135
+ if (!input) {
136
+ resultBox.innerHTML = '<p class="text-center text-red-300">Please enter a phoneme sequence first</p>';
137
+ return;
138
+ }
139
+
140
+ // In a real application, this would be replaced with a proper phonetic analysis algorithm
141
+ // For this demo, we'll just do simple pattern matching
142
+ let resultText = input;
143
+
144
+ // Replace known phonemes
145
+ for (const [phoneme, word] of Object.entries(phonemeMap)) {
146
+ resultText = resultText.replace(new RegExp(phoneme, 'g'), word);
147
+ }
148
+
149
+ // Capitalize first letter
150
+ resultText = resultText.charAt(0).toUpperCase() + resultText.slice(1);
151
+
152
+ resultBox.innerHTML = `<p class="text-white animate-pulse">${resultText}</p>`;
153
+
154
+ // Animation
155
+ anime({
156
+ targets: '#resultBox',
157
+ scale: [0.95, 1],
158
+ opacity: [0.8, 1],
159
+ duration: 500,
160
+ easing: 'easeOutQuad'
161
+ });
162
+ });
163
+
164
+ document.getElementById('clearBtn').addEventListener('click', function() {
165
+ document.getElementById('phonemeInput').value = '';
166
+ document.getElementById('resultBox').innerHTML = '<p class="text-center text-indigo-200">Your converted text will appear here...</p>';
167
+ });
168
+ </script>
169
+ </body>
170
  </html>