{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0a944076",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16.0\n",
      "15.2\n",
      "13.8\n",
      "15.5\n",
      "15.4\n",
      "14.9\n",
      "14.5\n",
      "15.4\n",
      "14.9\n",
      "14.1\n",
      "14.2\n",
      "15.0\n",
      "14.6\n",
      "15.3\n",
      "14.5\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import textstat\n",
    "\n",
    "# Define the base filename \n",
    "base_filename = \"NQ-MO-O\"\n",
    "\n",
    "# Define the number of files (in case we want to test on more than 15)\n",
    "num_files = 15  \n",
    "\n",
    "# Loop through each file\n",
    "for i in range(1, num_files + 1):\n",
    "    # Construct the filename\n",
    "    filename = f\"{base_filename}/{base_filename}_{i}.txt\"\n",
    "   \n",
    "    # Check if the file exists\n",
    "    if os.path.exists(filename):\n",
    "        # Open and read the file\n",
    "        with open(filename, 'r', encoding='utf-8') as file:\n",
    "            content = file.read()\n",
    "        fk = textstat.flesch_kincaid_grade(content)\n",
    "        print(fk)\n",
    "    else:\n",
    "        print(f\"{filename} does not exist.\")"
   ]
  }
 ],
 "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.13.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
