Skip to content
/ parsy Public

a concurrent syllable-parser for the English language

Notifications You must be signed in to change notification settings

XukuLLC/parsy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Parsy is a fast syllable-parser for English-language strings. It implements a standard algorithm and runs in parallel, making it an efficient and reliable solution for text-processing. Parsy accepts a string and returns a map with the following values:

  • :syl_count: an integer. The total number of syllables in string
  • :words: a list of lists. Each word in string and its individual :syl_count
  • :complex_words: a list of lists. Each complex word in string and its individual :syl_count. In English, a complex word is any word with three or more syllables. This value is often used to calculate readability scores.
  • :complex_count: an integer. The total number of complex_words in string.

Installation

If available in Hex, add parsy to your list of dependencies in mix.exs:

def deps do
  [
    {:parsy, "~> 0.1.4"}
  ]
end

Usage

Pass a string to Parsy.main(). Here is an example:

iex> Parsy.main("let's parse some syllables!")

process #PID<0.228.0>: syllabifying "{#PID<0.231.0>, #Reference<0.1896839920.1939079179.3341>}"

Every time Parsy spawns a new process, it will print the associated PID and reference number to the screen.

Once the computation completes, Parsy returns a map:

%{
  complex: [["syllables", 3]],
  complex_count: 1,
  syl_count: 6,
  words: [{"lets", 1}, {"parse", 1}, {"some", 1}, {"syllables", 3}]
}

About

a concurrent syllable-parser for the English language

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages