A word can be a lojban-word or a non-lojban-word.

A lojban-word can be a cmene, a cmavo or a brivla.

If the string begins with a cmene, extract it, else if it begins with a cmavo, extract it, else if it begins with a brivla, extract it, else it begins with a non-lojban-word, and so extract it.



The original document is available at https://tiki.lojban.org/Morphology%3A+words