9 "import os,sys,inspect\n",
10 "currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\n",
11 "parentdir = os.path.dirname(currentdir)\n",
12 "sys.path.insert(0,parentdir) "
22 "from support.utilities import *"
31 "text = open('history-words-raw.txt').read().lower()"
47 "output_type": "execute_result"
56 "execution_count": 14,
60 "cleaned = cat(c if c in string.ascii_letters else ' ' for c in unaccent(text))"
65 "execution_count": 15,
71 "' notoc noinclude europeanhistorytoc noinclude border id toc style margin auto'"
74 "execution_count": 15,
76 "output_type": "execute_result"
85 "execution_count": 16,
94 "execution_count": 16,
96 "output_type": "execute_result"
100 "cleaned_words = set(cleaned.split())\n",
106 "execution_count": 17,
115 "execution_count": 17,
117 "output_type": "execute_result"
121 "open('history-words.txt', 'w').write(lcat(cleaned_words))"
126 "execution_count": 18,
135 "execution_count": 18,
137 "output_type": "execute_result"
141 "'ottoman' in cleaned_words"
146 "execution_count": null,
154 "display_name": "Python 3",
155 "language": "python",
163 "file_extension": ".py",
164 "mimetype": "text/x-python",
166 "nbconvert_exporter": "python",
167 "pygments_lexer": "ipython3",