{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "import collections\n", "\n", "from tf.app import use" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Launch Text-Fabric with all features loaded" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "TF app is up-to-date.\n", "Using annotation/app-oldbabylonian commit 1f12c687368dec8eabefe35264a30f4d5eac3fb4 (=latest)\n", " in /Users/dirk/text-fabric-data/__apps__/oldbabylonian.\n", "No new data release available online.\n", "Using Nino-cunei/oldbabylonian/tf - 1.0.1 rv1.0.1 (=latest) in /Users/dirk/text-fabric-data.\n" ] }, { "data": { "text/html": [ "Documentation: OLDBABYLONIAN Character table Feature docs oldbabylonian API Text-Fabric API 7.4.11 Search Reference
Loaded features:\n", "

Old Babylonian Letters 1900-1600: Cuneiform tablets : after afterr afteru atf atfpost atfpre col collated collection comment damage det docnote docnumber excised face flags fraction grapheme graphemer graphemeu lang langalt ln lnc lnno missing object operator operatorr operatoru otype pnumber primecol primeln question reading readingr readingu remarkable remarks repeat srcLn srcLnNum srcfile supplied sym symr symu trans translation@ll type uncertain volume oslots

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
API members:\n", "C Computed, Call AllComputeds, Cs ComputedString
\n", "E Edge, Eall AllEdges, Es EdgeString
\n", "ensureLoaded, TF, ignored, loadLog
\n", "L Locality
\n", "cache, error, indent, info, reset
\n", "N Nodes, sortKey, sortKeyTuple, otypeRank, sortNodes
\n", "F Feature, Fall AllFeatures, Fs FeatureString
\n", "S Search
\n", "T Text
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A = use('oldbabylonian', hoist=globals(), check=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Quick exercises\n", "\n", "What are the determinatives?" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "determinatives = collections.Counter()\n", "\n", "for s in F.otype.s('sign'):\n", " if F.det.v(s):\n", " determinatives[F.reading.v(s) or F.grapheme.v(s)] += 1" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Counter({'d': 4078,\n", " 'disz': 1204,\n", " 'ki': 884,\n", " 'gesz': 271,\n", " 'sar': 84,\n", " 'muszen': 4,\n", " 'mi2': 46,\n", " 'gi': 39,\n", " 'na4': 17,\n", " 'lu2': 33,\n", " 'ap': 2,\n", " 'tug2': 31,\n", " 'am': 2,\n", " 'duru5': 5,\n", " 'dug': 2,\n", " 'ku': 1,\n", " 'iri': 28,\n", " 'gar': 3,\n", " 'kusz': 12,\n", " 'uruda': 11,\n", " 'u2': 4,\n", " 'i7': 1,\n", " 'iti': 1,\n", " 'ir': 1,\n", " 'p': 2,\n", " 'id2': 2,\n", " 'urudu': 7,\n", " 'asz': 1,\n", " 'gisz': 1,\n", " 'an': 2,\n", " 'uzu': 1,\n", " 'a': 2,\n", " 'sza3': 2,\n", " 'ti': 1,\n", " 'munus': 1,\n", " 'la': 1,\n", " 'ku6': 4,\n", " 'at': 1,\n", " 'ar': 1,\n", " 'szim': 3})" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "determinatives" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What is the language use?\n", "\n", "The main language is Akkadian, but parts are in the secondary language, which is Sumerian.\n", "\n", "All words with `langalt=1` are Sumerian:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "((1, 19064),)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.langalt.freqList()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What are the kinds of *signs*?\n", "\n", "Signs have a feature `type`, but so have clusters.\n", "We only want the frequencies of *sign* types:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(('reading', 188326),\n", " ('unknown', 8729),\n", " ('numeral', 2183),\n", " ('ellipsis', 1617),\n", " ('grapheme', 1272),\n", " ('commentline', 968),\n", " ('complex', 122),\n", " ('comment', 2))" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.type.freqList('sign')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "* **commentline**\n", " does not correspond to inscribed material, but is an artificial sign that carries a ` $ ` line comment\n", "* **comment** corresponds to an inline comment `($ $)`\n", "* **unknown**: the symbol `x` or `X`\n", "* **ellipsis**: the symbol `...`\n", "* **reading**: the most common sign, just containing a reading, e.g. `ma`\n", "* **grapheme**: a logogram, such as `ARAD`, which is not in the feature `reading` but in the feature `grapheme`\n", "* **numeral**: a complex sign, either a repetition of a reading or grapheme, or a combination of a fraction and a\n", " reading or grpaheme\n", "* **complex**: a complex sign, either a ligature of a reading and a grapheme connected by `x` or a correction\n", " of a reading by a grapheme, written as *reading*`!(`*grapheme*`)`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The total number of signs that correspond to something inscribed:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "202249 inscribed signs of which 191903 readable\n" ] } ], "source": [ "META_TYPES = {'commentline', 'comment'}\n", "READABLE_TYPES = {'reading', 'grapheme', 'numeral', 'complex'}\n", "\n", "inscribed = 0\n", "readable = 0\n", "\n", "for s in F.otype.s('sign'):\n", " typ = F.type.v(s)\n", " if typ in META_TYPES:\n", " continue\n", " inscribed += 1\n", " if typ in READABLE_TYPES:\n", " readable +=1\n", " \n", "print(f'{inscribed} inscribed signs of which {readable} readable')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Frequency of the readings (Akkadian) and of the graphemes (Sumerian)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(('a', 11672),\n", " ('ma', 11449),\n", " ('x', 8729),\n", " ('na', 8533),\n", " ('i', 4947),\n", " ('sza', 4737),\n", " ('szu', 4500),\n", " ('d', 4078),\n", " ('li', 3892),\n", " ('am', 3839),\n", " ('ta', 3431),\n", " ('ka', 3277),\n", " ('u2', 3258),\n", " ('ki', 3073),\n", " ('um', 2990),\n", " ('ni', 2865),\n", " ('la', 2740),\n", " ('bi', 2629),\n", " ('u3', 2552),\n", " ('ti', 2483),\n", " ('ba', 2456),\n", " ('disz', 2437),\n", " ('ri', 2354),\n", " ('ra', 2342),\n", " ('asz', 2275),\n", " ('nu', 2259),\n", " ('im', 2075),\n", " ('ia', 1811),\n", " ('al', 1767),\n", " ('di', 1648))" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.reading.freqList()[0:30]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(('...', 1617),\n", " ('ARAD', 119),\n", " ('GAN2', 102),\n", " ('BI', 54),\n", " ('DI', 48),\n", " ('ARAD2', 46),\n", " ('KU', 46),\n", " ('KI', 42),\n", " ('NI', 33),\n", " ('UD', 31),\n", " ('ZI', 30),\n", " ('GA', 29),\n", " ('BU', 28),\n", " ('KA', 28),\n", " ('PI', 25),\n", " ('ZU', 25),\n", " ('AD', 23),\n", " ('AB', 22),\n", " ('ZA', 22),\n", " ('ID', 21),\n", " ('NE', 19),\n", " ('AH', 18),\n", " ('SZI', 18),\n", " ('PA', 17),\n", " ('DU', 16),\n", " ('HI', 16),\n", " ('IG', 16),\n", " ('SU', 16),\n", " ('DA', 15),\n", " ('TA', 14))" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.grapheme.freqList()[0:30]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.2" } }, "nbformat": 4, "nbformat_minor": 2 }