tsengwoody / Access8Math

Allows access math content written by MathML ; Assist writing math content by LaTeX
GNU General Public License v2.0
31 stars 15 forks source link

Possible inefficiency in symbol_translate method #71

Closed thrintuim closed 1 year ago

thrintuim commented 2 years ago

https://github.com/tsengwoody/Access8Math/blob/9fc55e707a3deb44d235318226ac13ea40356043/addon/globalPlugins/Access8Math/A8M_PM.py#L397

There very well might be a good explanation for why this method is structured the way it is but it seems like it could be reduced to:

def symbol_translate(self, string):
    return self.mathcontent.symbol.get(string, string)

It seems like the same could be done for the braille_symbol_translate method but there may be something that I'm missing there.

tsengwoody commented 2 years ago

I think it makes a little difference in compound symbols in one node. For example "∽∿" will translate to "reversed tilde sine wave" now. but using dictionary get method will not translated in this case.