Hi everyone,
I am looking for a way to sort lines in a simple txt file for a wordlist/dictionary project. I know that in Textmate there is the
Bundles>Text>Sorting where I can sort the line alphabetically
according to latin based graphemes. My problem is that I am using IPA symbols a lot in the wordlist, e.g. ɸ, ⁿt, ð. The sort order in the Text bundle treats IPA characters as special symbols and puts them at the end, which is not what I want. So I was wondering if there is way of creating a custom sort order and apply it. For example: "a,æ,b,ᵐb,d,ⁿd,e,ɸ ..." instead of "a,b,c,d,e,f ..."
Best
Christian
On 1 Dec 2020, at 5:25, Christian Döhler via TextMate wrote:
So I was wondering if there is way of creating a custom sort order and apply it. For example: "a,æ,b,ᵐb,d,ⁿd,e,ɸ ..." instead of "a,b,c,d,e,f ..."
I don’t know what other options might be available built into the app, but for one-off text processing, there’s always “Filter Through Command…” which you can access with ⌘| (or ⇧⌘).
Hi,
two approaches came into my mind:
1) write you own command which makes usage of ICU collators and try to find a good locale which fulfills your need best (maybe DUCET).
2) write you own command which makes usage of your of sorting list. I mean almost all programming languages come with the possibility to apply a custom sort function to their own built-in sort mechanism, like Python - a good example here https://stackoverflow.com/questions/37355466/how-to-sort-a-list-of-strings-w...
I’d go with 2) since you can declare your own order.
Best, Hans
On 2. Dec 2020, at 13:35, Rob McBroom via TextMate textmate@lists.macromates.com wrote:
On 1 Dec 2020, at 5:25, Christian Döhler via TextMate wrote:
So I was wondering if there is way of creating a custom sort order and apply it. For example: "a,æ,b,ᵐb,d,ⁿd,e,ɸ ..." instead of "a,b,c,d,e,f ..."
I don’t know what other options might be available built into the app, but for one-off text processing, there’s always “Filter Through Command…” which you can access with ⌘| (or ⇧⌘).
-- Rob McBroom _______________________________________________ TextMate mailing list -- textmate@lists.macromates.com To unsubscribe send an email to textmate-leave@lists.macromates.com