Skip to content

Production version

Compare
Choose a tag to compare
@psolin psolin released this 20 Mar 12:29
· 138 commits to master since this release

I finally settled on the algorithm that I wanted, which is not only far more efficient, but allows people to add or remove whatever they want from each category without worry. The code is extremely compact but works the same as when it was 1,000 lines long.

The algorithm for removing suffixes was enhanced by sorting them in a single stack by length in descending order. This allows for the removal of items like "& co." first rather than "co.", so that the "&" would not be left behind.

Leading spaces before the suffixes in the list were removed in favor of this being added on later during a loop, meaning there is a lot more consistency to the data stored in the module, and less information stored in memory.

Finally, the 'short' function was removed in favor of only one to remove extraneous items in a company name.

There may be one or two more things to clean up, but it is efficient enough to call it a 1.0 version without hesitation.