/**
 * This function checks whether a given case description is mentioned in the lawyer's notes.
 *
 * @param caseDescription Description of the legal case.
 * @param lawyerNotes List of strings containing the lawyer's notes.
 * @return True if the case description is mentioned in the lawyer's notes, otherwise False.
 */
fun checkLegalCase(caseDescription: String, lawyerNotes: List<String>): Boolean {

    // Convert the case description to lowercase for case-insensitive comparison
    val caseDescriptionLower = caseDescription.toLowerCase()

    // Check each note in the lawyer's notes
    for (note in lawyerNotes) {
        // Split the note into words
        val words = note.split(" ")

        // Check if any word in the note matches the case description (ignoring punctuation and case)
        for (word in words) {
            // Remove punctuation from the word
            val cleanedWord = word.trim(' ', '.', ',', ':', ';', '!', '?')

            // Convert the word to lowercase for case-insensitive comparison
            val cleanedWordLower = cleanedWord.toLowerCase()

            // Check if the case description matches the word
            if (caseDescriptionLower == cleanedWordLower) {
                return true
            }
        }
    }
    return false
}
/**
 * This function checks whether a given case description is mentioned in the lawyer's notes.
 *
 * @param caseDescription Description of the legal case.
 * @param lawyerNotes List of strings containing the lawyer's notes.
 * @return True if the case description is mentioned in the lawyer's notes, otherwise False.
 */
fun checkLegalCase(caseDescription: String, lawyerNotes: List<String>): Boolean {
/**
 * This function checks whether a given case description is mentioned in the lawyer's notes.
 *
 * @param caseDescription Description of the legal case.
 * @param lawyerNotes List of strings containing the lawyer's notes.
 * @return True if the case description is mentioned in the lawyer's notes, otherwise False.
 */
fun checkLegalCase(caseDescription: String, lawyerNotes: List<String>): Boolean {

    // Convert the case description to lowercase for case-insensitive comparison
    val caseDescriptionLower = caseDescription.toLowerCase()

    // Check each note in the lawyer's notes
    for (note in lawyerNotes) {
        // Split the note into words
        val words = note.split(" ")

        // Check if any word in the note matches the case description (ignoring punctuation and case)
        for (word in words) {
            // Remove punctuation from the word
            val cleanedWord = word.trim(' ', '.', ',', ':', ';', '!', '?')

            // Convert the word to lowercase for case-insensitive comparison
            val cleanedWordLower = cleanedWord.toLowerCase()

            // Check if the case description matches the word
            if (caseDescriptionLower == cleanedWordLower) {
                return true
            }
        }
    }
    return false
}