Jump to content

gnomeplanet

New Members
  • Posts

    5
  • Joined

  • Last visited

gnomeplanet's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Psycho - yes, that's exactly what I have been doing: trying to think of a minimal yet suitable set of letter-number-punctuation combinations that would, when entered, illustrate the sort order that the Lightroom program produces. As far as I know, that last set of lines seem to show things off the best, though of course, I might be wrong about this. Have you a better idea to determine their full sort rules? One thing we can be reasonably sure of: they are sorting according to a standard sort in whatever program they use to write the Lightroom program. I can see no reason why they would have decided to create some unique sort for their own purposes, therefore the sort is, to them, a standard one. Its just strange to us, because PHP doesn't provide a similar ordering. I was rather hoping that someone who is familiar with PHP and the ?? language would recognise the order being produced and be able to provide some insight.
  2. Thanks, guys. Its very encouraging to see people taking this question seriously. It was only after doing some text processing in PHP that I noticed that there were differences in a supposedly 'standard' alphabetic sort from one place to another! ANSI value sort - PSPad abcd fgh abcd0 abcd1 abcd10 abcd11 abcd2 abcd22 abcd3 abcdefgh abcd'fgh abcd-fgh ASCII value sort - PSPad abcd fgh abcd'fgh abcd-fgh abcd0 abcd1 abcd10 abcd11 abcd2 abcd22 abcd3 abcdefgh NUMERIC VALUE sort - PSPad abcd fgh abcd0 abcd1 abcd10 abcd11 abcd2 abcd22 abcd3 abcdefgh abcd'fgh abcd-fgh The above orders were observed in the PSPad text editor, which gives a variety of ways to sort a list (plus ascending/descending). Just to remind you, the way that follows is the way that Adobe Lightroom sorts the list: abcd fgh abcd0 abcd1 abcd2 abcd3 abcd10 abcd11 abcd22 abcdefgh abcd'fgh abcd-fgh and as I am developing keyword lists for Lightroom, this is what I am trying to emulate in PHP. 'Psycho' adds another level of complication still! I guess the 'numbers first' rule is the one I prefer, to his list would sort as: abc10def abc1def abc2def Full marks to 'mac_gyver' for coming up with a working solution. The case of the letters is not important, as Lightroom ignores them anyway. Don't go to sleep, yet.... New Problem: I have been playing around some more, thinking that all would be fixed now, but then I realised there were still discrepancies: look at this new list: 20 def 20-45 20-def 20c 20cdef ab def ab-def abcd0 abcd1 abcd2 abcd12 abcdef Note how a space precedes a hyphen precedes a letter all of the time.. but Lightroom sorts this new list as: 20 def 20-45 20c 20cdef 20-def ab def abcd0 abcd1 abcd2 abcd12 abcdef ab-def What can be going on now?! What rules are these guys working to??
  3. Hi Barand. Yes, I have tried natsort. It gives the following order: abcd'fgh abcd-fgh abcd0 abcd1 abcd2 abcd3 abcd10 abcd11 abcd22 abcdefgh abcd fgh where the punctuation comes first, then the numbers (although the number order is correct), and then the letters, then the spaces. The order that I need is a standard one for ?? programming language. Someone must recognise the order, I would have thought.
  4. I am trying to create a custom sort. I realise that it will have to be a usort function, as none of the standard methods work. abcd fgh abcd0 abcd1 abcd2 abcd3 abcd10 abcd11 abcd22 abcdefgh abcd'fgh abcd-fgh The above is the order that I need my sort to output. Please notice the following: a/ the list may contain numerical, punctuation, or characters. b/ in the order of sorting, a space comes first, then numerical, then letters, then punctuation. c/ where there are numerical characters, they are sorted in numerical order. A variety of programs, such as Lightroom, already sort in this order, but I need to emulate this is PHP. I am hoping that someone may recognise the pattern, and so be able to help with a usort function to copy it. Thanking you for your consideration.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.