Skip to content

Commit d0b5dd6

Browse files
committed
Revert "Fix details"
This reverts commit d863cc1.
1 parent d863cc1 commit d0b5dd6

4 files changed

Lines changed: 27 additions & 24 deletions

File tree

2 Import corpora.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
}
435435
],
436436
"source": [
437-
"!ls -l /home/kyle/cltk_data/originals/ # To be adapted to your file system"
437+
"!ls -l /home/kyle/cltk_data/originals/"
438438
]
439439
}
440440
],

3 Basic NLP.ipynb

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -692,32 +692,27 @@
692692
"# The easiest way to do this in Python is to use a list comprehension to remove stopwords\n",
693693
"\n",
694694
"from cltk.stop.latin.stops import STOPS_LIST\n",
695+
"\n",
695696
"print(STOPS_LIST)"
696697
]
697698
},
698699
{
699700
"cell_type": "code",
700-
"execution_count": 1,
701+
"execution_count": 44,
701702
"metadata": {},
702703
"outputs": [
703704
{
704-
"ename": "NameError",
705-
"evalue": "name 'cato_cltk_word_tokens_no_punt' is not defined",
706-
"output_type": "error",
707-
"traceback": [
708-
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
709-
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
710-
"\u001b[0;32m<ipython-input-1-730f01962f9b>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mcato_no_stops\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mw\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcato_cltk_word_tokens_no_punt\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mSTOPS_LIST\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# Note that the stopwords are gone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;31m#! Consider others you might want to add to the Latin stops list\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
711-
"\u001b[0;31mNameError\u001b[0m: name 'cato_cltk_word_tokens_no_punt' is not defined"
705+
"name": "stdout",
706+
"output_type": "stream",
707+
"text": [
708+
"['interdum', 'praestare', 'mercaturis', 'rem', 'quaerere', 'periculosum', 'sit', 'item', 'foenerari', 'honestum', 'maiores', 'nostri', 'habuerunt', 'legibus', 'posiverunt', 'furem', 'dupli', 'condemnari', 'foeneratorem', 'quadrupli', 'quanto', 'peiorem', 'civem', 'existimarint', 'foeneratorem', 'furem', 'hinc', 'licet', 'existimare', 'virum', 'bonum', 'quom', 'laudabant', 'laudabant', 'bonum', 'agricolam', 'bonum', '-que', 'colonum', 'amplissime', 'laudari', 'existimabatur', 'laudabatur', 'mercatorem', 'strenuum', 'studiosum', '-que', 'rei', 'quaerendae', 'existimo', 'verum', 'supra', 'dixi', 'periculosum', 'calamitosum', 'agricolis', 'viri', 'fortissimi', 'milites', 'strenuissimi', 'gignuntur', 'maxime', '-que', 'pius', 'quaestus', 'stabilissimus', '-que', 'consequitur', 'minime', '-que', 'invidiosus', 'minime', '-que', 'male', 'cogitantes', 'sunt', 'eo', 'studio', 'occupati', 'sunt', 'nunc', 'rem', 'redeam', 'quod', 'promisi', 'institutum', 'principium', 'hoc', 'erit']\n"
712709
]
713710
}
714711
],
715712
"source": [
716713
"cato_no_stops = [w for w in cato_cltk_word_tokens_no_punt if not w in STOPS_LIST]\n",
717-
"\n",
718-
"# Note that the stopwords are gone\n",
719-
"#! Consider others you might want to add to the Latin stops list\n",
720-
"\n",
714+
"# observe no stopwords\n",
715+
"#! consider others you might want to add to the Latin stops list\n",
721716
"print(cato_no_stops)"
722717
]
723718
}

5 Text reuse.ipynb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -11,8 +11,15 @@
1111
"import os\n",
1212
"\n",
1313
"div1_fp = os.path.expanduser('~/cltk_data/latin/text/latin_text_latin_library/cicero/divinatione1.txt')\n",
14-
"div2_fp = os.path.expanduser('~/cltk_data/latin/text/latin_text_latin_library/cicero/divinatione2.txt')\n",
15-
"\n",
14+
"div2_fp = os.path.expanduser('~/cltk_data/latin/text/latin_text_latin_library/cicero/divinatione2.txt')"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": 2,
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
1623
"with open(div1_fp) as fo:\n",
1724
" div1 = fo.read()\n",
1825
"\n",

9 Lexical Dispersion Plot.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"cell_type": "code",
44-
"execution_count": 1,
44+
"execution_count": 2,
4545
"metadata": {},
4646
"outputs": [],
4747
"source": [
@@ -61,8 +61,8 @@
6161
" words[i] = words[i].lower()\n",
6262
" if lang in [\"bn\",\"hi\",\"sa\"]:\n",
6363
" tokens= i_word(text)\n",
64-
"\n",
65-
" # Locating the matches of the words in the text\n",
64+
" \n",
65+
" # Locating the matches of the words in the text. \n",
6666
" x_length = len(tokens)\n",
6767
" y_length = len(words)\n",
6868
" x_list = []\n",
@@ -72,16 +72,17 @@
7272
" if tokens[i]==words[j]:\n",
7373
" x_list.append(i+1)\n",
7474
" y_list.append(j)\n",
75-
"\n",
76-
" # Creation of Dispersion Plot with Matplotlib's pyplot\n",
75+
" \n",
76+
" #Creation of Dispersion Plot with Matplotlib's pyplot. \n",
7777
" plt.plot(x_list, y_list, \"b|\", scalex=.1)\n",
7878
" plt.yticks(list(range(len(words))), words, color=\"b\")\n",
7979
" plt.ylim(-1, len(words))\n",
8080
" plt.xlabel(\"Lexical Distribution\")\n",
8181
" plt.show()\n",
82-
"\n",
82+
" \n",
8383
" else:\n",
84-
" print(\"Language not presently covered by CLTK or wrong language code\") "
84+
" print(\"Language not presently covered by CLTK or wrong language code\") \n",
85+
" \n"
8586
]
8687
},
8788
{

0 commit comments

Comments
 (0)