Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A replacement for OfTrailingConsonantIsSequence function #13

Open
javiaxum opened this issue Jan 4, 2024 · 1 comment
Open

A replacement for OfTrailingConsonantIsSequence function #13

javiaxum opened this issue Jan 4, 2024 · 1 comment
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@javiaxum
Copy link

javiaxum commented Jan 4, 2024

Cheers, just getting started with Syllabore but want to express my appreciation for the authors' work. So far this solution fits my needs the best of all I could find on Github.

This might be a mix of general questions and bug reports here, so I may split them into distinct issues.
I did read all the guides on the wiki. My version is 2.3.2.

  • So, in order to control last syllable's coda cluster I tried to set the probability for trailing consonants at 1 using the deprecated OfTrailingConsonantIsSequence function, since this is the only function I found which is able to configure that. Documentation suggests to use OfTrailingConsonants but then it appears to me I'm unable to assure the syllable does end with a coda cluster at all.

A side question there:

  • Should a SyllableGenerator with no vowel graphemes provided return an empty string? Also guide 1.1.2 mentions that onset and coda are optional, is that from a linguistic perspective or it is intended to be a constraint for SyllableGenerator?
    Are vowels intended to be mandatory to specify for SyllableGenerator to function?
    If I have no probabilities specified for SyllableGenerator making coda cluster to occur all the time, I get an exception due to an empty string generated as a result.

  • Also I noticed that when I try to override DefaultSyllableGenerator (and SyllableGenerator as well) trailing consonant cluster without specifying the probability, it never returns a syllable containing the coda cluster specified. (And in case of Syllable generator, an empty string is returned as mentioned above).

And tiny remarks for the guides:

  • 3.1 Section has a typo?
    Quote: "Names with three or more consonants in a row look are also difficult to read. Our NameFilter allows use to also identify patterns we want to avoid through regular expressions:"
  • At the end of the section a deprecated UsingProvider method is being used.

Thanks for your time!

@kesac
Copy link
Owner

kesac commented Jan 5, 2024

Thanks for your interest in the library! Here are my responses to each bug/question:

Coda clusters in the final syllable

Coda clusters in the final syllable can be controlled using a combination of WithFinalConsonantSequences() and OfFinalConsonants() like so:

var syllables = new SyllableGenerator()
    .WithVowels("ae")
    .WithLeadingConsonants("srl")
    .WithFinalConsonantSequences("th") // "Final consonants" are trailing consonants used in the final syllable only
    .WithProbability(x => x
        .OfFinalConsonants(1.0, 1.0)); // 100% chance of a final coda, 100% chance the coda is a coda cluster

A NameGenerator using the SyllableGenerator above would produce names like Saleth or Raseth.

Using a combination of WithTrailingConsonantSequences() and OfTrailingSequences() would also work, but the coda cluster th would appear in the opening and intermediate syllables too. (eg. Sathleth, Rathseth)

My sincere apologies: I now realize the wiki is missing information about final consonants and I will ensure the wiki gets updated to include it.

Should a SyllableGenerator with no vowel graphemes provided return an empty string?

In a scenario where a SyllableGenerator has no vowels defined it should occasionally throw exceptions during syllable generation unless the consonant probability is set to 100% or empty string generation is explicitly permitted.

This would be ok to use:

var syllables = new SyllableGenerator()
    .WithLeadingConsonants("srl")
    .AllowEmptyStrings(true);

And this would be ok too:

var syllables = new SyllableGenerator()
    .WithLeadingConsonants("srl")
    .WithProbability(x => x
        .OfLeadingConsonants(1)
        .OfVowels(0));

Other side questions/comments

Guide 1.1.2 mentions that onset and coda are optional, is that from a linguistic perspective or it is intended to be a constraint for SyllableGenerator?

Great question, I need to update 1.1.2 as this is from a linguistic perspective only.

Are vowels intended to be mandatory to specify for SyllableGenerator to function?

Vowels are mandatory if the vowel probability is not zero and SyllableGenerator should throw an exception during generation (ie. when it reaches into the vowel pool and finds no graphemes to use).

Also I noticed that when I try to override...

I agree this is a bug, I will look into it. You should be able to define vowels and clusters only, and have it all appear in the output space without touching the probability table.

3.1 Section has a typo?

Thanks I will get it corrected!

At the end of the section a deprecated UsingProvider method is being used.

Thanks! I will also get this corrected!


Edits:

  • Where it said "...unless the vowel probability is set to zero..." has been corrected to "...unless the consonant probability is set to 100%..." (The default consonant probability is not 100% by default)

@kesac kesac self-assigned this Jan 5, 2024
@kesac kesac added bug Something isn't working documentation Improvements or additions to documentation labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants