Skip to content

Commit

Permalink
[python] Handle stemmer names with underscore
Browse files Browse the repository at this point in the history
Previously the code generated in __init__.py didn't convert to camel
case correctly if there was an underscore.
  • Loading branch information
ojwb committed Oct 2, 2023
1 parent b630f75 commit 5db5bca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/create_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
match = filematch.match(pyscript)
if (match):
langname = match.group(1)
titlecase = langname.title()
titlecase = re.sub(r"_", "", langname.title())
languages.append(" '%(lang)s': %(title)sStemmer," % {'lang': langname, 'title': titlecase})
imports.append('from .%(lang)s_stemmer import %(title)sStemmer' % {'lang': langname, 'title': titlecase})
imports.sort()
Expand Down

0 comments on commit 5db5bca

Please sign in to comment.