I want to use a word with a single quote in the vocabulary. For example, supposing I have something called ‘Bill’s house’. I want to be able to refer to it as ‘bill’s’, ‘house’ or ‘bill’s house’. In the first case, ‘bill’s’ is a noun. In the last, ‘bill’s’ is an adjective. I can enter this word in the editor and it doesn’t complain, but the word isn’t recognised in the game.
I have used a test like : if (original "noun1" == "bill's" || original "noun1" == "house") and ‘bill’s’ isn’t recognised. Some debugging code indicates that the single quote is deleted so that ‘bill’s’ becomes ‘bills’. That could prove to be a problem because ‘bills’ is used for something else.
I also added an entry in the vocabulary table that says : noun / aliases = [bill's, house], but that didn’t make any difference.
I could probably try the undocumented experimental_matching_text_sequences, but this can only be used with objects and ‘Bill’s house’ is not an object.
Any suggestions? What other characters are stripped off during parsing?
Try using experimental_replace in the vocabulary section.
That does not need to be associated with the object and will search and replace text patterns prior to parsing. Thinking to move that to a parser{} section (not yet added).
Format works, but it doesn’t do anything. I tried : experimental_replace text = "doll's" with = "dolls"; and : experimental_replace text = "dolls" with = "doll's"; and in both cases, noun1 was ‘dolls’ after entering either ‘doll's’ or ‘dolls’.
Oh, yes, that will happen. Special characters are currently stripped in a different step.
It’ll need a bit of thought to remove this
For now you could simply alias to the non apostrophe version and make sure there is no conflict. If there is a conflict with another noun, then alias to an unrelated noun and set up your object with that noun.
This is a workaround, not a solution, I appreciate this.
Anyway, knowing this use case will help, and again, this isn’t a good solution, but it is a workaround.
My example with Bill’s house was actually hypothetical. Now that I know what Adventuron is doing, I can test for the word without the single quote and it works. Because of the context, the plural form is not an issue. I can still check for that separately elsewhere, if needed.