Delete processDoubles.ipynb
Browse files- processDoubles.ipynb +0 -52
processDoubles.ipynb
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"cells": [
|
3 |
-
{
|
4 |
-
"cell_type": "code",
|
5 |
-
"execution_count": null,
|
6 |
-
"id": "5912ba94-833f-4662-8b8c-f201b5dde892",
|
7 |
-
"metadata": {},
|
8 |
-
"outputs": [],
|
9 |
-
"source": [
|
10 |
-
"# Function to process \"double\" followed by a number\n",
|
11 |
-
"def process_doubles(sentence):\n",
|
12 |
-
" tokens = sentence.split()\n",
|
13 |
-
" result = []\n",
|
14 |
-
" i = 0\n",
|
15 |
-
" while i < len(tokens):\n",
|
16 |
-
" if tokens[i] == \"डबल\":\n",
|
17 |
-
" if i + 1 < len(tokens):\n",
|
18 |
-
" result.append(tokens[i + 1])\n",
|
19 |
-
" result.append(tokens[i + 1])\n",
|
20 |
-
" i += 2\n",
|
21 |
-
" else:\n",
|
22 |
-
" result.append(tokens[i])\n",
|
23 |
-
" i += 1\n",
|
24 |
-
" else:\n",
|
25 |
-
" result.append(tokens[i])\n",
|
26 |
-
" i += 1\n",
|
27 |
-
" return ' '.join(result)\n"
|
28 |
-
]
|
29 |
-
}
|
30 |
-
],
|
31 |
-
"metadata": {
|
32 |
-
"kernelspec": {
|
33 |
-
"display_name": "Python 3 (ipykernel)",
|
34 |
-
"language": "python",
|
35 |
-
"name": "python3"
|
36 |
-
},
|
37 |
-
"language_info": {
|
38 |
-
"codemirror_mode": {
|
39 |
-
"name": "ipython",
|
40 |
-
"version": 3
|
41 |
-
},
|
42 |
-
"file_extension": ".py",
|
43 |
-
"mimetype": "text/x-python",
|
44 |
-
"name": "python",
|
45 |
-
"nbconvert_exporter": "python",
|
46 |
-
"pygments_lexer": "ipython3",
|
47 |
-
"version": "3.11.7"
|
48 |
-
}
|
49 |
-
},
|
50 |
-
"nbformat": 4,
|
51 |
-
"nbformat_minor": 5
|
52 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|