{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "files = ['dumping-iium.txt', 'dumping-news.txt', 'dumping-parliament.txt', 'dumping-pdf.txt',\n",
    "'dumping-watpadd.txt', 'dumping-wiki.txt']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "prefix = '../bert/'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dumping-iium.txt 1139839\n",
      "dumping-news.txt 1897307\n",
      "dumping-parliament.txt 960869\n",
      "dumping-pdf.txt 651957\n",
      "dumping-watpadd.txt 1500470\n",
      "dumping-wiki.txt 2050802\n"
     ]
    }
   ],
   "source": [
    "texts = []\n",
    "\n",
    "for file in files:\n",
    "    with open(f'{prefix}{file}') as fopen:\n",
    "        x = fopen.read().split('\\n')\n",
    "        \n",
    "    print(file, len(x))\n",
    "    texts.extend(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8201244"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(texts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('combined.txt', 'w') as fopen:\n",
    "    fopen.write('\\n'.join(texts))"
   ]
  }
 ],
 "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.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
