supriya-project / uqbar

Tools for building documentation with Sphinx, Graphviz and LaTeX
https://supriya-project.github.io/uqbar
MIT License
13 stars 7 forks source link

Reimplement delimit_words #79

Closed jgarte closed 1 year ago

jgarte commented 1 year ago

Hi,

Why does delimit_words need to be re-implemented?

You left a TODO comment here:

https://github.com/josiah-wolf-oberholtzer/uqbar/blob/main/uqbar/strings.py#L44

Is it because the function is too long?

josiah-wolf-oberholtzer commented 1 year ago

Probably. Probably could be mostly solved by a regex.

jgarte commented 1 year ago

What was the idea with the wordlike_characters checking variable?

I see in a repl that this function ignore characters like @, #, $, %, ^, &, *, etc.

>>> list(delimit_words("<hello><world>"))
['<', 'hello', '><', 'world', '>']
>>> list(delimit_words("!!!go go power rangers!!!"))
['!!!', 'go', 'go', 'power', 'rangers', '!!!']
>>> list(delimit_words("@parse;here@"))
['parse', 'here']
josiah-wolf-oberholtzer commented 1 year ago

Looks like it's mainly used to break up class names into component words, e.g. AbstractClass -> ["Abstract", "class"]

https://github.com/josiah-wolf-oberholtzer/uqbar/blob/2ec2309daca511117018bf14eb0d6b50938f50ca/uqbar/apis/graphs.py#L354

Are you looking to reimplement this, or just asking questions? If you're just poking around, take it to the discussions section you previously asked for.

jgarte commented 1 year ago

I would like to reimplement it, yes, for practice, but I'm first trying to scope out what would be accepted/needed for it in a PR.

Let me know if I should do that first over at discussions or just keep the thread here.

Feel free to leave the issue closed for now if it creates too much noise.

Looks like it's mainly used to break up class names into component words, e.g. AbstractClass -> ["Abstract", "class"]

I'll study that next, thanks!