Some chords (at least in Common Practice Period harmony) cannot be named out of context. Some trivial examples: F-Ab-Db-F is a Db major chord in and of itself but if resolved to G, it may be a Neapolitan Sixth.
The collection: Ab-C-Eb-F# is a German Sixth if resolved to G-C-E-G thence to G-B-D-G(or F). It's a dominant seventh if resolved to Db-F-Ab or perhaps a tritone substitution. Possibly using F# for the German Sixth and Gb for the dominant seventh helps however composers do approach the chord as a German Sixth and resolve it as dominant seventh and vice versa.
Some ambiguities are matters of taste. In San Antonio Rose (the only song I can think of quickly that does this) the opening chords are Bb-Eb-C7-F7; when I play this piece or other similar pieces I think I-IV-II7-V7 (especially as vocalists may want me to transpose) but while laying out a chord scheme during composing, I think I-IV-V7/V-V7 which shows the structure and would explain a Bb-Eb-C7-d-g-c6-F7-Bb as a secondary dominant resolving on a deceptive cadence followed by a cycle of fifths.
One thing you could do (to get back to the original question) is to rearrange the note collection to have as many thirds as possible and name the chord from there. Moving the notes around should indicate which inversion one has. D-F-G-B can be arranged to be G-B-D-F with a maor third followed by by three minor thirds.