{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from SolveShorts import *\n",
|
|
"\n",
|
|
"from oi import *\n",
|
|
"\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"solSh = SolveShorts('hkldbShorts.hkl', 'hkldbShorts_All.hkl')\n",
|
|
"\n",
|
|
"#solSh.create_hklDB_from_csv('Abkuerzungen.txt')\n",
|
|
"\n",
|
|
"oi = oi()\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"sentences, punctuations = oi.ReadDoc2Sent('test1')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"loading hkldbShorts ..\n",
|
|
"done\n",
|
|
"loading the bow model\n",
|
|
"done\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"solSh.load_DB_into_FASTsearch()\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"processing sentence 1\n",
|
|
"processing sentence 2\n",
|
|
"processing sentence 3\n",
|
|
"processing sentence 4\n",
|
|
"processing sentence 5\n",
|
|
"processing sentence 6\n",
|
|
"processing sentence 7\n",
|
|
"processing sentence 8\n",
|
|
"processing sentence 9\n",
|
|
"processing sentence 10\n",
|
|
"processing sentence 11\n",
|
|
"processing sentence 12\n",
|
|
"processing sentence 13\n",
|
|
"processing sentence 14\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"outsentences = solSh.ExplainShortsInSentencesWithBrackets(sentences)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n",
|
|
".\n"
|
|
]
|
|
},
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"'OK'"
|
|
]
|
|
},
|
|
"execution_count": 6,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"oi.PrintSplitSentencesToTextFile(punctuations, outsentences, 'test1out')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"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.5.3"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|