BinaryJazz / genrenator

Random genre creation
https://binaryjazz.us/genrenator-api/
GNU General Public License v3.0
11 stars 0 forks source link

Spaces appear before some suffixes #5

Closed jazzsequence closed 6 years ago

jazzsequence commented 6 years ago

The suffixes o and ism still appear with spaces before them. There might be more but these are the ones I've noticed thus far. Any others observed should be added to this ticket.

jazzsequence commented 6 years ago

I think this is happening because we have a space added to genres with the texturize method. All the suffixes that need spaces have them in the string, so an additional space is unnecessary (and probably why we were seeing doublespaces). #10 needs testing but I think this should solve the issue.

binarygary commented 6 years ago

I've tested and I see the issue. However, I'm quite unclear (I've run myself in circles) on whether the constants should contain spaces or not. It seems the responsibility of determining the spacing should fall solely in the patterns? https://github.com/BinaryJazz/genrenator/blob/master/inc/genrenator.php#L21 That would alleviate the seesaw effect (as I see it) that we are currently fighting?

jazzsequence commented 6 years ago

I have unofficially decided that the constants should not have spaces. I was trying to use the texturize method to add spaces as needed but that ran into inconsistent results as well. Perhaps the best solution is just to adjust the patterns which seems like it would remove the necessity of having that texturize method.

jazzsequence commented 6 years ago

@binarygary another thing that is playing into this and causing many of the headaches is some prefixes don't have spaces and some suffixes don't have spaces. Everything that is spaced normally tends to work okay but the stuff that needs to be a contraction is more likely to break. I'm considering changing those into separate fragments and adjusting the patterns to accommodate. I've been avoiding that but I'm wondering if it's the best solution.