LOC sort

Report your bugs here - if someone else has already mentioned the same bug, just add on to their post with as much info as possible to make the hunting easier.

LOC sort

Postby vinteuil » Thu Oct 15, 2015 5:52 pm

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?
vinteuil
Contributor
Contributor
 
Posts: 6
Joined: Thu Oct 15, 2015 5:50 pm

Re: LOC sort

Postby Conor » Sat Oct 17, 2015 5:07 am

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.
User avatar
Conor
Top Dog
 
Posts: 4797
Joined: Sat Jul 03, 2004 12:58 pm

Re: LOC sort

Postby Conor » Sat Oct 17, 2015 5:12 am

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".
User avatar
Conor
Top Dog
 
Posts: 4797
Joined: Sat Jul 03, 2004 12:58 pm

Re: LOC sort

Postby vinteuil » Sun Dec 06, 2015 12:38 am

Is this going to be fixed anytime soon? Or is there a way to manually change how the field is sorted?
vinteuil
Contributor
Contributor
 
Posts: 6
Joined: Thu Oct 15, 2015 5:50 pm

Re: LOC sort

Postby vinteuil » Fri Mar 04, 2016 11:18 pm

Bump/hello?
vinteuil
Contributor
Contributor
 
Posts: 6
Joined: Thu Oct 15, 2015 5:50 pm

Re: LOC sort

Postby Conor » Sat Mar 05, 2016 4:02 pm

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;
User avatar
Conor
Top Dog
 
Posts: 4797
Joined: Sat Jul 03, 2004 12:58 pm

Re: LOC sort

Postby vinteuil » Tue Mar 15, 2016 7:13 pm

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.
vinteuil
Contributor
Contributor
 
Posts: 6
Joined: Thu Oct 15, 2015 5:50 pm

Re: LOC sort

Postby Conor » Wed Mar 16, 2016 5:24 am

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.
User avatar
Conor
Top Dog
 
Posts: 4797
Joined: Sat Jul 03, 2004 12:58 pm

Re: LOC sort

Postby vinteuil » Tue Mar 29, 2016 8:19 pm

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/
vinteuil
Contributor
Contributor
 
Posts: 6
Joined: Thu Oct 15, 2015 5:50 pm

Re: LOC sort

Postby DanCornett » Sat Oct 08, 2016 9:14 am

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
DanCornett
Junior Member
Junior Member
 
Posts: 4
Joined: Thu Feb 15, 2007 11:49 am

Re: LOC sort

Postby Conor » Fri Aug 25, 2017 7:07 am

Latest Bookpedia beta has a fix for LCC sort.
User avatar
Conor
Top Dog
 
Posts: 4797
Joined: Sat Jul 03, 2004 12:58 pm


Return to Bug Reports