/**
 * This function takes a string as input and analyzes the text based on certain conditions.
 *
 * @param inputText The text to be analyzed
 * @return The result of the analysis in a formatted string
 */
fun analyzeText(inputText: String): String {

    val wordDict = mapOf(
        "nouns" to listOf("dog", "cat", "car", "apple"),
        "verbs" to listOf("run", "eat", "drive", "sleep"),
        "adjectives" to listOf("happy", "big", "green", "tasty")
    )

    var nounCount = 0
    var verbCount = 0
    var adjectiveCount = 0

    val words = inputText.toLowerCase().split(" ")

    for (word in words) {
        when {
            word in wordDict["nouns"]!! -> nounCount++
            word in wordDict["verbs"]!! -> verbCount++
            word in wordDict["adjectives"]!! -> adjectiveCount++
        }
    }

    val result = "The text contains $nounCount nouns, $verbCount verbs, and $adjectiveCount adjectives."
    return result
}
/**
 * This function takes a string as input and analyzes the text based on certain conditions.
 *
 * @param inputText The text to be analyzed
 * @return The result of the analysis in a formatted string
 */
fun analyzeText(inputText: String): String {
/**
 * This function takes a string as input and analyzes the text based on certain conditions.
 *
 * @param inputText The text to be analyzed
 * @return The result of the analysis in a formatted string
 */
fun analyzeText(inputText: String): String {

    val wordDict = mapOf(
        "nouns" to listOf("dog", "cat", "car", "apple"),
        "verbs" to listOf("run", "eat", "drive", "sleep"),
        "adjectives" to listOf("happy", "big", "green", "tasty")
    )

    var nounCount = 0
    var verbCount = 0
    var adjectiveCount = 0

    val words = inputText.toLowerCase().split(" ")

    for (word in words) {
        when {
            word in wordDict["nouns"]!! -> nounCount++
            word in wordDict["verbs"]!! -> verbCount++
            word in wordDict["adjectives"]!! -> adjectiveCount++
        }
    }

    val result = "The text contains $nounCount nouns, $verbCount verbs, and $adjectiveCount adjectives."
    return result
}