"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("@oclif/command");
const BaseCommand_1 = require("../utils/BaseCommand");
const console_1 = require("../utils/console");
const creatorUtilities_1 = require("../utils/creatorUtilities");
const exampleMd = `# How to Install Node.js

Node.js lets you run JavaScript outside a web browser.

## Step 1: Download Node.js

Get the Node.js installer from the [official site](https://nodejs.org/en/download/).

## Step 2: Install Node.js

Open the installer and follow the steps to finish.

## Step 3: Verify the Installation

Open a terminal and type:

\`\`\`bash
node -v
\`\`\`
`;
class BreakTokenCommand extends BaseCommand_1.default {
    async run() {
        const { flags } = this.parse(BreakTokenCommand);
        // await SessionManager.breakToken()
        const paragraphs = (0, creatorUtilities_1.extractParagraphs)(exampleMd);
        for (const paragraph of paragraphs) {
            const syllables = (0, creatorUtilities_1.splitIntoSyllables)(paragraph);
            const words = (0, creatorUtilities_1.extractWords)(paragraph);
            const sentences = (0, creatorUtilities_1.countSentences)(paragraph);
            const fkgl = (0, creatorUtilities_1.fleschKincaidGrade)(paragraph);
            console_1.default.info(paragraph);
            console_1.default.info(`Number of syllables: ${syllables.length}`);
            console_1.default.info(syllables);
            console_1.default.info(`Number of words: ${words.length}`);
            console_1.default.info(words);
            console_1.default.info(`Number of sentences: ${sentences}`);
            console_1.default.info(`FKGL: ${fkgl}`);
            console_1.default.info("---");
        }
        process.exit(0);
    }
}
BreakTokenCommand.description = "Break the token";
BreakTokenCommand.flags = Object.assign(Object.assign({}, BaseCommand_1.default.flags), { grading: command_1.flags.help({ char: "h" }) });
exports.default = BreakTokenCommand;
