hasMeaningfulContent method

bool hasMeaningfulContent()

Check if note contains meaningful content

Implementation

bool hasMeaningfulContent() {
  final String cleanNote = trim().toLowerCase();

  // Must contain at least one alphabetic word of 3+ characters
  final bool hasRealWords = RegExp(r'\b[a-zA-Z]{3,}\b').hasMatch(this);
  if (!hasRealWords) return false;

  // Should contain some descriptive content
  final List<String> meaningfulWords = <String>[
    'faculty',
    'university',
    'college',
    'school',
    'department',
    'level',
    'floor',
    'room',
    'building',
    'campus',
    'student',
    'study',
    'exam',
    'class',
    'course',
    'near',
    'close',
    'next',
    'opposite',
    'behind',
    'engineering',
    'medicine',
    'science',
    'arts',
    'business',
    'library',
    'cafeteria',
    'lab',
    'lecture',
    'hall',
  ];

  return meaningfulWords.any((String word) => cleanNote.contains(word)) ||
      hasEducationalContext() ||
      hasLocationDetails();
}