Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (63 sloc) 4.12 KB

sylvia-mode

./basic-usage.gif

sylvia-mode for Emacs is an environment for working with text with a focus on pronunciation and sound, such as when composing song lyrics or slam poetry. Powered by the Sylvia python package, it facilitates word-finding via phoneme patterns using an elaborate regular expression format. The major-mode also provides various contextual hints during editing.

Feature Highlights:

  • Phoneme Regex Queries
    • Free-form entry of Sylvia-format phonetic regular expressions.
    • Matching words are offered to user, and selection is pushed onto the kill-ring.
    • Optionally, field is prefilled with the phonemes for the word-at-point, or words-in-region.
  • Rhyming Words
    • List words which rhyme with word-at-point, or words-in-region.
    • Matching words are offered to user, and selection is pushed onto the kill-ring.
  • Interactive Rhyming Regex Creation
    • Generates a phonetic regular expression from the word-at-point, or words-in-region, which would strictly match “rhyming” words.
    • Support for different “rhyme-levels” of various strictness (loose, default, and perfect).
    • The regular expression may be edited by the user before the query is executed.
  • Phonemes at Point displayed in Echo Area
  • Syllable Counts in window margin.
  • Infers the pronunciation of words which are not present in the CMU dictionary.
  • Sorts results for all functions by word popularity using Google’s N-Gram dataset.

Installation

To use sylvia-mode, you just need to install the sylvia Python package and the sylvia emacs package.

As described in the Sylvia package README:

pip2 install sylvia

The emacs component is not yet in MELPA. To install, download sylvia.el somewhere in your load-path, and then install the dependencies in emacs;

M-x package-install <return> epc <return>
M-x package-install <return> dash <return>

Usage

Installation

Require the Sylvia package in your Emacs init file (after placing sylvia.el in your load-path);

(require 'sylvia)

Then, open a new buffer or text file and type M-x sylvia-mode.

Keymap

KeyFunctionDescription
C-c C-qsylvia:copy-regex-query-result-as-killFreeform phonetic regex query.
C-c C-rsylvia:copy-rhyme-as-killQuery with editable pre-generated rhyming-regex

Exposed End-User Functions

sylvia:copy-regex-query-result-as-kill

This command allows you to:

  • Enter a free-form phonetic regex query.
  • After hitting <return>, all known matching words will be listed via completing-read
  • The selected result is pushed onto the kill-ring.

Check the Sylvia Python package README for more complete documentation on the phonetic regex format.

sylvia:copy-rhyme-as-kill

Without prefix argument, this command lists all rhyming words for the word-at-point, or words-in-region, using the “default” rhyme-level.

With prefix argument, it will:

  • Prompt for a rhyme-level (loose, default, or perfect) via completing-read
  • Generate a phonetic regex which satisfies that rhyme-level using word-at-point, or words-in-region
  • Allow free-form editing of the regex, then finally, upon <return>
  • List matching words of that regex via completing-read
  • The selected result is pushed onto the kill-ring.

Contributing

sylvia-mode is developed in sylvia.org. Please make all changes there, and then tangle-them to sylvia.el via org-babel-tangle-file.

This software is roughly early beta quality, and anyone interested in contributed is very welcome to do so!

For a list of known issues feature ideas, and links to relevant research and documentation, check out the development notes!

You can’t perform that action at this time.