Skip to content

Commit e6dbabd

Browse files
committed
Merge branch 'tutorials_greek'
2 parents 724c029 + e2e7e1b commit e6dbabd

11 files changed

Lines changed: 3100 additions & 7 deletions

2 Import corpora.ipynb

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

9 Lexical Dispersion Plot.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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
{
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Install Python\n",
8+
"\n",
9+
"## Mac\n",
10+
"\n",
11+
"See <https://www.python.org/downloads/> (current version is 3.6.4).\n",
12+
"\n",
13+
"\n",
14+
"## Linux\n",
15+
"\n",
16+
"Open Terminal and check current version with `python --version` or `python3 --version`. If 3.4 or 3.5, you're fine. If Python version is out of date, run these:\n",
17+
"\n",
18+
"``` bash\n",
19+
"$ curl -O https://raw.githubusercontent.com/kylepjohnson/python3_bootstrap/master/install.sh\n",
20+
"$ chmod +x install.sh\n",
21+
"$ ./install.sh\n",
22+
"```\n",
23+
"\n",
24+
"This Linux build from source will take around 5 minutes."
25+
]
26+
},
27+
{
28+
"cell_type": "markdown",
29+
"metadata": {},
30+
"source": [
31+
"# Install Git\n",
32+
"\n",
33+
"The CLTK uses Git for corpus management. For Mac, install it from here: <https://git-scm.com/downloads>. For Linux, check if present (`git --version`); if not then use your package manager to get it (e.g., `apt-get install git`)."
34+
]
35+
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"# Create a virtual environment\n",
41+
"\n",
42+
"This makes a special environment (a \"sandbox\") just for the CLTK. If something goes wrong, you can just delete it and start again.\n",
43+
"\n",
44+
"``` bash\n",
45+
"$ cd ~/\n",
46+
"$ mkdir cltk\n",
47+
"$ cd cltk\n",
48+
"$ pyvenv venv\n",
49+
"$ source venv/bin/activate\n",
50+
"```\n",
51+
"\n",
52+
"Now you can see that you're not using your system Python but this particular one:\n",
53+
"\n",
54+
"``` bash\n",
55+
"$ which python\n",
56+
"```\n",
57+
"\n",
58+
"Note that every time you open a new Terminal window, you'll need to \"activate\" this environment with `source ~/cltk/venv/bin/activate`."
59+
]
60+
},
61+
{
62+
"cell_type": "markdown",
63+
"metadata": {},
64+
"source": [
65+
"# Install CLTK\n",
66+
"\n",
67+
"``` bash\n",
68+
"$ pip install cltk\n",
69+
"```\n",
70+
"\n",
71+
"This will take a few minutes, as it will install several \"dependencies\", being other Python libraries which the CLTK uses.\n",
72+
"\n",
73+
"Also install Jupyter, which is a really handy way of writing code.\n",
74+
"\n",
75+
"``` bash\n",
76+
"$ pip install jupyter\n",
77+
"```"
78+
]
79+
},
80+
{
81+
"cell_type": "markdown",
82+
"metadata": {},
83+
"source": [
84+
"# Test Jupyter\n",
85+
"\n",
86+
"From your `cltk` directory, launch a notebook (such as this one) from the Terminal with `jupyter notebook`. Then open your preferred browser to <http://localhost:8888>."
87+
]
88+
},
89+
{
90+
"cell_type": "markdown",
91+
"metadata": {},
92+
"source": [
93+
"# Download these tutorials\n",
94+
"\n",
95+
"You may find these instructions at <https://github.com/cltk/tutorials>."
96+
]
97+
},
98+
{
99+
"cell_type": "markdown",
100+
"metadata": {},
101+
"source": [
102+
"# Join GitHub\n",
103+
"\n",
104+
"GitHub is a nice way to share code. Come visit us at <https://github.com/cltk/cltk/>!"
105+
]
106+
}
107+
],
108+
"metadata": {
109+
"kernelspec": {
110+
"display_name": "Python 3",
111+
"language": "python",
112+
"name": "python3"
113+
},
114+
"language_info": {
115+
"codemirror_mode": {
116+
"name": "ipython",
117+
"version": 3
118+
},
119+
"file_extension": ".py",
120+
"mimetype": "text/x-python",
121+
"name": "python",
122+
"nbconvert_exporter": "python",
123+
"pygments_lexer": "ipython3",
124+
"version": "3.6.4"
125+
}
126+
},
127+
"nbformat": 4,
128+
"nbformat_minor": 1
129+
}

0 commit comments

Comments
 (0)