giellatekno / neahttadigisanit

Saami dictionary webapp
Other
2 stars 2 forks source link

config: strip_spaces - why? #21

Closed Phaqui closed 4 months ago

Phaqui commented 5 months ago

There is a setting called strip_spaces in project config files. It is boolean, and when it is True, the search will run through a .strip() (stripping away whitespace at the beginning and end), before it is passed on to lexical lookup and analysis. It is set to True in all templates, and all active configurations which is live.

Why does this functionality exist - why doesn't the code just always .strip() the input?

trondtynnol commented 4 months ago

If I remember correctly, I implemented this on a user's suggestion, but wanted to make sure it did not break any other functionality, so I made it easily switchable. I guess the setting could be removed and the strip be done unconditionally now, as we have not seen any problems with the functionality.

Phaqui commented 4 months ago

Okay, sounds good. I was also hesitant to just remove it immediately, in case there was some use case I did not understand.

Phaqui commented 4 months ago

Implemented as of cb78f9feb3799d5e7ac1ba0e55b259d29dcb851a