Page 1 of 1

LOC sort

Posted: Thu Oct 15, 2015 5:52 pm
by vinteuil
Hi—I've just switched from Delicious Library, and I noticed that I can no longer sort properly by library of congress catalogue—the sort simply goes character by character, so that, for instance "B1290 2008" comes before "B188 .F714 1988". Is there any good solution for this?

Re: LOC sort

Posted: Sat Oct 17, 2015 5:07 am
by Conor
Thanks for the feedback. I have code explicitly looking for the LOC and sorting character by character. Now why it does that, there is no comment on the code. But there must have been a good reason, let me investigate and find out why that might be the case.

Re: LOC sort

Posted: Sat Oct 17, 2015 5:12 am
by Conor
After some searching, the LCC numbers are meant to be sorted as text and not numbers. The behavior is the correct behavior for the sorting of LCC on a shelf and library.

In a simpler example "B3" needs to come after "B19999".

Re: LOC sort

Posted: Sun Dec 06, 2015 12:38 am
by vinteuil
Is this going to be fixed anytime soon? Or is there a way to manually change how the field is sorted?

Re: LOC sort

Posted: Fri Mar 04, 2016 11:18 pm
by vinteuil
Bump/hello?

Re: LOC sort

Posted: Sat Mar 05, 2016 4:02 pm
by Conor
The sorting is correct.

There is no way to break the proper sorting of LCC numbers. If you want them to sort like regular numbers you could move the data to number field that is not being used, such as paid. You can do this directly in the SQL database with the following command in TerminalL

Code: Select all

sqlite3 ~/Library/Application\ Support/Bookpedia/Database.bookpd
update zentry set zpaid = zlcc;

Re: LOC sort

Posted: Tue Mar 15, 2016 7:13 pm
by vinteuil
I'm not sure I understand your response—it seems like you're saying that the LCC sorting is working already. I've attached a picture of how the sort works for my library:
http://imgur.com/dPjyzza
Image

EDIT: On the other hand, your fix worked fine in the opposite direction, sending LCC to a custom text field.

Re: LOC sort

Posted: Wed Mar 16, 2016 5:24 am
by Conor
Thank you for the image. Indeed, the sorting is working correctly. I know it seems wrong to sort B1835 before B188. But this is the way LCC is sorted and the way you would find the books at the library. I.e. they are not numbers but categories; B18 is closer to category B2 than B1835.

We actually go out of our way to do this sorting on the LCC field with a custom sort. Hence why moving the data to any other custom field will suddenly sort it the way you expected with the numbers in numerical order.

Re: LOC sort

Posted: Tue Mar 29, 2016 8:19 pm
by vinteuil
I see now where the confusion was. But I'm not sure you're right about the correct sorting. Sorting that way completely destroys the topical ordering of books (for instance, it puts random choral works between the piano works), I've never seen a library sort that way, and it's not how the LOC itself sorts it in their outline of the classification: https://www.loc.gov/catdir/cpso/lcco/

Re: LOC sort

Posted: Sat Oct 08, 2016 9:14 am
by DanCornett
re: "... it's not how the LOC itself sorts it in their outline of the classification ..."

I just looked at that link, and the LOC list is indeed, to my eyes "sorted as text", not as numeric values.

If one thinks of the "numbers" as a "positional hierarchy" of characters, then it may make more sense.

Example: (from a LOC link sub-page, using 'periods' to approximate spacing):

ML1-3930 ... Literature on music
ML1-5 ............... Periodicals. Serials
ML12-21 ........... Directories. Almanacs

Re: LOC sort

Posted: Fri Aug 25, 2017 7:07 am
by Conor
Latest Bookpedia beta has a fix for LCC sort.