|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "# Runes\n", |
| 8 | + "Note: in order to use this Jupyter notebook, you need at least python 3.6 or above." |
| 9 | + ] |
| 10 | + }, |
| 11 | + { |
| 12 | + "cell_type": "markdown", |
| 13 | + "metadata": {}, |
| 14 | + "source": [ |
| 15 | + "Configure ipython.\n", |
| 16 | + "\n", |
| 17 | + "```bash\n", |
| 18 | + "$ ipython profile create\n", |
| 19 | + "$ ipython locate\n", |
| 20 | + "$ nano .ipython/profile_default/ipython_config.py\n", |
| 21 | + "```\n", |
| 22 | + " Add it a the end of the file (without '#'):\n", |
| 23 | + "```bash\n", |
| 24 | + "c.InteractiveShellApp.exec_lines = [\n", |
| 25 | + " 'import sys; sys.path.append(\"/home/<username>/<path to runes-analyzer>\")'\n", |
| 26 | + "]\n", |
| 27 | + "```\n", |
| 28 | + " And... It's done!" |
| 29 | + ] |
| 30 | + }, |
| 31 | + { |
| 32 | + "cell_type": "markdown", |
| 33 | + "metadata": {}, |
| 34 | + "source": [ |
| 35 | + "In a shell, install the module **runesanalyzer**\n", |
| 36 | + "```bash\n", |
| 37 | + "$ git clone https://github.com/cltk/runes-analyzer.git\n", |
| 38 | + "$ cd runes-analyzer\n", |
| 39 | + "$ python3.6 setup.py install \n", |
| 40 | + "```\n", |
| 41 | + "Install the kernel associated with python3.6 [https://ipython.readthedocs.io/en/stable/install/kernel_install.html](https://ipython.readthedocs.io/en/stable/install/kernel_install.html) " |
| 42 | + ] |
| 43 | + }, |
| 44 | + { |
| 45 | + "cell_type": "markdown", |
| 46 | + "metadata": {}, |
| 47 | + "source": [ |
| 48 | + "Let's test if the import is correct:\n", |
| 49 | + "```bash\n", |
| 50 | + "$ python3.6\n", |
| 51 | + "```" |
| 52 | + ] |
| 53 | + }, |
| 54 | + { |
| 55 | + "cell_type": "code", |
| 56 | + "execution_count": 1, |
| 57 | + "metadata": {}, |
| 58 | + "outputs": [], |
| 59 | + "source": [ |
| 60 | + "from runesanalyzer import data" |
| 61 | + ] |
| 62 | + }, |
| 63 | + { |
| 64 | + "cell_type": "markdown", |
| 65 | + "metadata": {}, |
| 66 | + "source": [ |
| 67 | + "First of all, let's see what runes are:" |
| 68 | + ] |
| 69 | + }, |
| 70 | + { |
| 71 | + "cell_type": "code", |
| 72 | + "execution_count": 2, |
| 73 | + "metadata": {}, |
| 74 | + "outputs": [ |
| 75 | + { |
| 76 | + "name": "stdout", |
| 77 | + "output_type": "stream", |
| 78 | + "text": [ |
| 79 | + "[ᚠ, ᚢ, ᚦ, ᚨ, ᚱ, ᚲ, ᚷ, ᚹ, ᚺ, ᚾ, ᛁ, ᛃ, ᛇ, ᛈ, ᛉ, ᛊ, ᛏ, ᛒ, ᛖ, ᛗ, ᛚ, ᛜ, ᛟ, ᛞ]\n", |
| 80 | + "[ᚠ, ᚢ, ᚦ, ᚭ, ᚱ, ᚴ, ᚼ, ᚾ, ᛁ, ᛅ, ᛋ, ᛏ, ᛒ, ᛖ, ᛘ, ᛚ, ᛦ]\n", |
| 81 | + "[ᚠ, ᚢ, ᚦ, ᚭ, ᚱ, ᚴ, ᚽ, ᚿ, ᛁ, ᛅ, ᛌ, ᛐ, ᛓ, ᛖ, ᛙ, ᛚ, ᛧ]\n" |
| 82 | + ] |
| 83 | + } |
| 84 | + ], |
| 85 | + "source": [ |
| 86 | + "for alphabet in [data.ELDER_FUTHARK, data.YOUNGER_FUTHARK, data.SHORT_TWIG_YOUNGER_FUTHARK]:\n", |
| 87 | + " print(alphabet)" |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "cell_type": "markdown", |
| 92 | + "metadata": {}, |
| 93 | + "source": [ |
| 94 | + "The oldest runic inscriptions found are from 200 AC. They have always denoted Germanic languages. Until the 8th century, the elder *futhark* alphabet was used. It was compouned with 24 characters: ᚠ, ᚢ, ᚦ, ᚨ, ᚱ, ᚲ, ᚷ, ᚹ, ᚺ, ᚾ, ᛁ, ᛃ, ᛇ, ᛈ, ᛉ, ᛊ, ᛏ, ᛒ, ᛖ, ᛗ, ᛚ, ᛜ, ᛟ, ᛞ. The word *Futhark* comes from the 6 first characters of the alphabet: ᚠ (f), ᚢ (u), ᚦ (th), ᚨ (a), ᚱ (r), ᚲ (k). Later, this alphabet was reduced to 16 runes, the *younger futhark* ᚠ, ᚢ, ᚦ, ᚭ, ᚱ, ᚴ, ᚼ, ᚾ, ᛁ, ᛅ, ᛋ, ᛏ, ᛒ, ᛖ, ᛘ, ᛚ, ᛦ, with more ambiguity on sounds. Shapes of runes may vary according to which matter they are carved on, that is why there is a variant of the *younger futhark* like this: ᚠ, ᚢ, ᚦ, ᚭ, ᚱ, ᚴ, ᚽ, ᚿ, ᛁ, ᛅ, ᛌ, ᛐ, ᛓ, ᛖ, ᛙ, ᛚ, ᛧ." |
| 95 | + ] |
| 96 | + }, |
| 97 | + { |
| 98 | + "cell_type": "code", |
| 99 | + "execution_count": 3, |
| 100 | + "metadata": {}, |
| 101 | + "outputs": [], |
| 102 | + "source": [ |
| 103 | + "from runesanalyzer import runes" |
| 104 | + ] |
| 105 | + }, |
| 106 | + { |
| 107 | + "cell_type": "markdown", |
| 108 | + "metadata": {}, |
| 109 | + "source": [ |
| 110 | + "Get the available runic alphabets" |
| 111 | + ] |
| 112 | + }, |
| 113 | + { |
| 114 | + "cell_type": "code", |
| 115 | + "execution_count": 4, |
| 116 | + "metadata": {}, |
| 117 | + "outputs": [], |
| 118 | + "source": [ |
| 119 | + "from runesanalyzer.data import RunicAlphabetName" |
| 120 | + ] |
| 121 | + }, |
| 122 | + { |
| 123 | + "cell_type": "code", |
| 124 | + "execution_count": 5, |
| 125 | + "metadata": {}, |
| 126 | + "outputs": [ |
| 127 | + { |
| 128 | + "name": "stdout", |
| 129 | + "output_type": "stream", |
| 130 | + "text": [ |
| 131 | + "elder_futhark\n", |
| 132 | + "younger_futhark\n", |
| 133 | + "short_twig_younger_futhark\n" |
| 134 | + ] |
| 135 | + } |
| 136 | + ], |
| 137 | + "source": [ |
| 138 | + "for name in RunicAlphabetName:\n", |
| 139 | + " print(name.value)" |
| 140 | + ] |
| 141 | + }, |
| 142 | + { |
| 143 | + "cell_type": "markdown", |
| 144 | + "metadata": {}, |
| 145 | + "source": [ |
| 146 | + "Some famous runic inscriptions" |
| 147 | + ] |
| 148 | + }, |
| 149 | + { |
| 150 | + "cell_type": "code", |
| 151 | + "execution_count": 6, |
| 152 | + "metadata": {}, |
| 153 | + "outputs": [ |
| 154 | + { |
| 155 | + "data": { |
| 156 | + "text/plain": [ |
| 157 | + "'᛬ᚴᚢᚱᛘᛦ᛬ᚴᚢᚾᚢᚴᛦ᛬ᚴ(ᛅᚱ)ᚦᛁ᛬ᚴᚢᛒᛚ᛬ᚦᚢᛋᛁ᛬ᛅ(ᚠᛏ)᛬ᚦᚢᚱᚢᛁ᛬ᚴᚢᚾᚢ᛬ᛋᛁᚾᛅ᛬ᛏᛅᚾᛘᛅᚱᚴᛅᛦ᛬ᛒᚢᛏ᛬'" |
| 158 | + ] |
| 159 | + }, |
| 160 | + "execution_count": 6, |
| 161 | + "metadata": {}, |
| 162 | + "output_type": "execute_result" |
| 163 | + } |
| 164 | + ], |
| 165 | + "source": [ |
| 166 | + "data.little_jelling_stone" |
| 167 | + ] |
| 168 | + }, |
| 169 | + { |
| 170 | + "cell_type": "code", |
| 171 | + "execution_count": 7, |
| 172 | + "metadata": {}, |
| 173 | + "outputs": [ |
| 174 | + { |
| 175 | + "data": { |
| 176 | + "text/plain": [ |
| 177 | + "'ᚼᛅᚱᛅᛚᛏᚱ᛬ᚴᚢᚾᚢᚴᛦ᛬ᛒᛅᚦ᛬ᚴᛅᚢᚱᚢᛅ ᚴᚢᛒᛚ᛬ᚦᛅᚢᛋᛁ᛬ᛅᚠᛏ᛬ᚴᚢᚱᛘ ᚠᛅᚦᚢᚱ ᛋᛁᚾ ᛅᚢᚴ ᛅᚠᛏ᛬ᚦᚭᚢᚱᚢᛁ᛬ᛘᚢᚦᚢᚱ᛬ᛋᛁᚾᛅ᛬ᛋᛅ ᚼᛅᚱᛅᛚᛏᚱ(᛬)ᛁᛅᛋ᛬ᛋᚭᛦ᛫ᚢᛅᚾ᛫ᛏᛅᚾᛘᛅᚢᚱᚴ\\nᛅᛚᛅ᛫ᛅᚢᚴ᛫ᚾᚢᚱᚢᛁᚴ\\n᛫ᛅᚢᚴ᛫ᛏ(ᛅ)ᚾᛁ(᛫ᚴᛅᚱᚦᛁ᛫)ᚴᚱᛁᛋᛏᚾᚭ'" |
| 178 | + ] |
| 179 | + }, |
| 180 | + "execution_count": 7, |
| 181 | + "metadata": {}, |
| 182 | + "output_type": "execute_result" |
| 183 | + } |
| 184 | + ], |
| 185 | + "source": [ |
| 186 | + "data.big_jelling_stone" |
| 187 | + ] |
| 188 | + }, |
| 189 | + { |
| 190 | + "cell_type": "markdown", |
| 191 | + "metadata": {}, |
| 192 | + "source": [ |
| 193 | + "Runes are encoded in UTF-8 from \\u16A0 ᚠ to \\u16FF ᛪ. See https://en.wikipedia.org/wiki/Runic_(Unicode_block)" |
| 194 | + ] |
| 195 | + }, |
| 196 | + { |
| 197 | + "cell_type": "markdown", |
| 198 | + "metadata": {}, |
| 199 | + "source": [ |
| 200 | + "Interesting, but why a Python module for runes? This module provides:\n", |
| 201 | + "* metadata attached to runes (runic alphabet which it is in, its representation, the approximate sound it describes, the transcription, the name)\n", |
| 202 | + "* a rune to latin character transcriber \n", |
| 203 | + "* a unified method to retrieve corpora of runic inscriptions " |
| 204 | + ] |
| 205 | + }, |
| 206 | + { |
| 207 | + "cell_type": "code", |
| 208 | + "execution_count": 8, |
| 209 | + "metadata": {}, |
| 210 | + "outputs": [ |
| 211 | + { |
| 212 | + "data": { |
| 213 | + "text/plain": [ |
| 214 | + "ᚠ" |
| 215 | + ] |
| 216 | + }, |
| 217 | + "execution_count": 8, |
| 218 | + "metadata": {}, |
| 219 | + "output_type": "execute_result" |
| 220 | + } |
| 221 | + ], |
| 222 | + "source": [ |
| 223 | + "data.ELDER_FUTHARK[0]" |
| 224 | + ] |
| 225 | + }, |
| 226 | + { |
| 227 | + "cell_type": "markdown", |
| 228 | + "metadata": {}, |
| 229 | + "source": [ |
| 230 | + "Runes are defined with the **Rune** class in the *rune* module." |
| 231 | + ] |
| 232 | + }, |
| 233 | + { |
| 234 | + "cell_type": "code", |
| 235 | + "execution_count": 9, |
| 236 | + "metadata": {}, |
| 237 | + "outputs": [ |
| 238 | + { |
| 239 | + "data": { |
| 240 | + "text/plain": [ |
| 241 | + "ᚠ" |
| 242 | + ] |
| 243 | + }, |
| 244 | + "execution_count": 9, |
| 245 | + "metadata": {}, |
| 246 | + "output_type": "execute_result" |
| 247 | + } |
| 248 | + ], |
| 249 | + "source": [ |
| 250 | + "data.Rune(data.RunicAlphabetName.elder_futhark, \"\\u16A0\", \"f\", \"f\", \"fehu\")" |
| 251 | + ] |
| 252 | + }, |
| 253 | + { |
| 254 | + "cell_type": "markdown", |
| 255 | + "metadata": {}, |
| 256 | + "source": [ |
| 257 | + "Use the **Transcriber** class to get a basic transcription of a runic inscription." |
| 258 | + ] |
| 259 | + }, |
| 260 | + { |
| 261 | + "cell_type": "code", |
| 262 | + "execution_count": 10, |
| 263 | + "metadata": {}, |
| 264 | + "outputs": [ |
| 265 | + { |
| 266 | + "data": { |
| 267 | + "text/plain": [ |
| 268 | + "'᛫kurmR᛫kunukR᛫k(ar)þi᛫kubl᛫þusi᛫a(ft)᛫þurui᛫kunu᛫sina᛫tanmarkaR᛫but᛫'" |
| 269 | + ] |
| 270 | + }, |
| 271 | + "execution_count": 10, |
| 272 | + "metadata": {}, |
| 273 | + "output_type": "execute_result" |
| 274 | + } |
| 275 | + ], |
| 276 | + "source": [ |
| 277 | + "data.Transcriber.transcribe(data.little_jelling_stone, data.YOUNGER_FUTHARK)" |
| 278 | + ] |
| 279 | + }, |
| 280 | + { |
| 281 | + "cell_type": "code", |
| 282 | + "execution_count": 11, |
| 283 | + "metadata": {}, |
| 284 | + "outputs": [], |
| 285 | + "source": [ |
| 286 | + "from runesanalyzer import scraper" |
| 287 | + ] |
| 288 | + }, |
| 289 | + { |
| 290 | + "cell_type": "markdown", |
| 291 | + "metadata": {}, |
| 292 | + "source": [ |
| 293 | + "If you want to import all the Sweden runic inscriptions, call the following function." |
| 294 | + ] |
| 295 | + }, |
| 296 | + { |
| 297 | + "cell_type": "code", |
| 298 | + "execution_count": null, |
| 299 | + "metadata": {}, |
| 300 | + "outputs": [ |
| 301 | + { |
| 302 | + "data": { |
| 303 | + "text/plain": [ |
| 304 | + "<function runesanalyzer.scraper.retrieve_sweden_runic_inscription()>" |
| 305 | + ] |
| 306 | + }, |
| 307 | + "execution_count": 12, |
| 308 | + "metadata": {}, |
| 309 | + "output_type": "execute_result" |
| 310 | + } |
| 311 | + ], |
| 312 | + "source": [ |
| 313 | + "scraper.retrieve_sweden_runic_inscription" |
| 314 | + ] |
| 315 | + }, |
| 316 | + { |
| 317 | + "cell_type": "markdown", |
| 318 | + "metadata": {}, |
| 319 | + "source": [ |
| 320 | + "Future tasks:\n", |
| 321 | + "* normalizing runic inscriptions and transcriptions\n", |
| 322 | + "* making a statistics module to analyze frequencies of words, runes, spellings in runic inscriptions.\n", |
| 323 | + "* getting more runic inscriptions from Norway, Denmark, etc\n", |
| 324 | + "* using phonetical rules [module](https://github.com/cltk/cltk/blob/master/cltk/phonology/utils.py) to get a normalized pronunciation of Old norse inscriptions written with runes.\n", |
| 325 | + " " |
| 326 | + ] |
| 327 | + }, |
| 328 | + { |
| 329 | + "cell_type": "markdown", |
| 330 | + "metadata": {}, |
| 331 | + "source": [ |
| 332 | + "By Clément Besnier, email address: clemsciences@aol.com" |
| 333 | + ] |
| 334 | + } |
| 335 | + ], |
| 336 | + "metadata": { |
| 337 | + "kernelspec": { |
| 338 | + "display_name": "Python 3.6", |
| 339 | + "language": "python", |
| 340 | + "name": "python3" |
| 341 | + }, |
| 342 | + "language_info": { |
| 343 | + "codemirror_mode": { |
| 344 | + "name": "ipython", |
| 345 | + "version": 3 |
| 346 | + }, |
| 347 | + "file_extension": ".py", |
| 348 | + "mimetype": "text/x-python", |
| 349 | + "name": "python", |
| 350 | + "nbconvert_exporter": "python", |
| 351 | + "pygments_lexer": "ipython3", |
| 352 | + "version": "3.6.3" |
| 353 | + } |
| 354 | + }, |
| 355 | + "nbformat": 4, |
| 356 | + "nbformat_minor": 1 |
| 357 | +} |
0 commit comments