Ad
Ad
Ad
Pages: [1]   Bottom of Page
Print
Author Topic: Keyword Order  (Read 1822 times)
Rendezvous
Jr. Member
**
Offline Offline

Posts: 51


WWW
« on: June 12, 2012, 02:03:11 AM »
ReplyReply

Looking through my keyword list I came across this part, which is a list of aircraft type codes (yeah, I'm a plane spotter). Any idea why Lightroom has sorted B77W above something such as B733? Surely 73 comes before 77?
Logged

Peter Stacey
Full Member
***
Offline Offline

Posts: 154


« Reply #1 on: June 12, 2012, 02:09:03 AM »
ReplyReply

I'm sure Jeff will have the most definitive answer, but in looking at that list, it looks as though Lightroom compares the whole int value, not iterating through each individual digit.

So 77 < 733

Just a guess though.

Regards,

Peter
« Last Edit: June 12, 2012, 02:15:54 AM by Peter Stacey » Logged

Peter Thomson
Newbie
*
Offline Offline

Posts: 5


« Reply #2 on: June 12, 2012, 03:14:20 AM »
ReplyReply

& 74<77
Logged
Tony Jay
Sr. Member
****
Offline Offline

Posts: 2046


« Reply #3 on: June 12, 2012, 03:31:01 AM »
ReplyReply

The answer is all in character sets and how they are interpreted.
All characters are numbered codes.
Letters come before numbers.

Regards

Tony Jay
Logged
Rendezvous
Jr. Member
**
Offline Offline

Posts: 51


WWW
« Reply #4 on: October 10, 2012, 06:56:24 PM »
ReplyReply

Surely  "B73..." would still come before "B77...." regardless of what the fourth character is?
Logged

aduke
Sr. Member
****
Offline Offline

Posts: 360


« Reply #5 on: October 10, 2012, 09:21:10 PM »
ReplyReply

The answer is all in character sets and how they are interpreted.
All characters are numbered codes.
Letters come before numbers.

Regards

Tony Jay

Actually, in the Ansi code scheme, the numbers have lower code values than the lower-case letters which have lower code values than the upper-case letters. The keyboard special characters are interspersed throughout the sequence.

Alan
Logged
jeremypayne
Guest
« Reply #6 on: October 10, 2012, 09:58:33 PM »
ReplyReply

This is one of those 'things' you can literally spend days discussing with developers.



Logged
Tony Jay
Sr. Member
****
Offline Offline

Posts: 2046


« Reply #7 on: October 11, 2012, 04:37:12 AM »
ReplyReply

Actually, in the Ansi code scheme, the numbers have lower code values than the lower-case letters which have lower code values than the upper-case letters. The keyboard special characters are interspersed throughout the sequence.

Actually Lr uses Unicode not ASCII but the general principle is correct.

The issue revolves around how Lr (the SQLite database in fact) "perceives" STRINGS of characters rather than individual characters.
If B733 is perceived as B-733 (ie 733 as a number) or B-7-3-3 (each character treated separately) it changes how it is parsed when compared to B77.
In the first case B77 will be placed before B733 and in the second case B733 will come before B77.

I am in the process of investigating exactly how alphanumeric strings are handled in Lightroom (as opposed to pure alphabetical strings or pure numeric strings). When I know the answer I will report back.

Regards

Tony Jay
Logged
Rhossydd
Sr. Member
****
Offline Offline

Posts: 1889


WWW
« Reply #8 on: October 11, 2012, 04:52:58 AM »
ReplyReply

Surely  "B73..." would still come before "B77...." regardless of what the fourth character is?
Why would you ever ignore the digits in a mathematical sequence ?
It seems obvious that seventy three would always be before seven hundred and anything in an ascending sequence.
Logged
Tony Jay
Sr. Member
****
Offline Offline

Posts: 2046


« Reply #9 on: October 11, 2012, 08:51:38 PM »
ReplyReply

I have done an extensive search on the web for an answer to this question.
Apart from very technical articles dealing with Unicode that are almost completely inpenetrable there is not a lot to find.

So, going back to Lightroom itself it is very clear that consecutive numeric characters in keywords are interpreted by Lightroom as a number and not as two consecutive Unicode characters that happen to be numeric characters.
Thus, B77 is interpreted as B-77 and B733 is interpreted as B-733.
Therefore as numbers 77 < 733 and so 77 precedes 733 in keyword order.
The B in front of the numeric characters does not change the observed behaviour.

I am not sure if this behaviour is a default of Unicode itself, default behaviour in SQLite, or behaviour specifically programmed into SQLite by the Adobe Lightroom engineers.
I have not found any information on the web that appears to answer this question but I also readily admit that I know next-to-nothing about SQL datadase programming and as previously stated the technical information about Unicode that I uncovered may as well have been in Mandarin for all the enlightenment it gave me.

One individual, that I am aware of, who may have some insight on this issue that frequents LuLa forums is John Beadsworth.

Regards

Tony Jay
Logged
john beardsworth
Sr. Member
****
Offline Offline

Posts: 2668



WWW
« Reply #10 on: October 12, 2012, 12:54:29 AM »
ReplyReply

I'm pretty certain it's not SQL. My guess is after getting the raw data from the database, two or three things are going on in the Lua code. There's certainly code which breaks up data into individual words (see the smart collection criteria "contains words"), so with keywords there's probably code that breaks out consecutive numerical characters and treats them as another column for sorting. In the original example, B77W comes above B733 because it's sorting first by the initial letter, then on the number. I can imagine circumstances where this would produce a "wrong" order, but plenty where it's surprisingly clever.

Logged

Tony Jay
Sr. Member
****
Offline Offline

Posts: 2046


« Reply #11 on: October 12, 2012, 01:28:39 AM »
ReplyReply

Thanks John - that was my thought too but just no way of proving it.

(BTW apologies for the missing 'r' in your surname.)

Regards

Tony Jay
Logged
Rendezvous
Jr. Member
**
Offline Offline

Posts: 51


WWW
« Reply #12 on: October 13, 2012, 03:06:09 AM »
ReplyReply

Thanks for the replies - quite interesting. Of course, it doesn't really matter as long as I can search for the keywords, which I can.
Logged

Pages: [1]   Top of Page
Print
Jump to:  

Ad
Ad
Ad