Learn R Programming

contentanalysis (version 0.2.1)

count_syllables: Count syllables in a word

Description

Estimates the number of syllables in an English word using improved heuristic rules.

Usage

count_syllables(word)

Value

Integer number of syllables

Arguments

word

Character string containing a single word

Details

Uses a rule-based approach with multiple adjustments:

  • Counts vowel groups (consecutive vowels = 1 syllable)

  • Adjusts for silent 'e' at end of words

  • Handles common suffixes and prefixes

  • Special cases for diphthongs and common patterns

  • Ensures minimum of 1 syllable