Library of Congress Classification (LCC) now sorts correctly

TalkNew features

Join LibraryThing to post.

Library of Congress Classification (LCC) now sorts correctly

1timspalding
Edited: Dec 5, 2007, 11:05 pm

After considerable discussion (see here), I've introduced true Library of Congress Classification (LCC) sorting in your catalog.

The system now sorts by the LCC's rules (see here), which differ from alphanumeric sorting in various ways.

Of course, many books do not have LCC data. LibraryThing tries to use the "work" level where it can, but this only goes so far. Others have numbers which aren't valid, like "MLC R CP01162" or "9810 BOOK NOT YET IN LC."

The new system should work well, but if you have any problems, feel free to work through them here.

Note on speed: Ultimately I had to choose between bloating the database with normalized forms or slowing things down. I chose the latter. It should be fast enough after you've sorted your collection once or twice.

2markbarnes
Dec 6, 2007, 2:39 am

I don't use LCC (I use Dewey instead), but I can see why people like me would find this really important, so I just want to say thanks for listening and putting the time into this - especally when there's so much else going on.

3philosojerk
Dec 6, 2007, 8:52 am

This looks really great. Thanks Tim!

4dcmdale
Dec 6, 2007, 9:20 am

Thank you!

5lorax
Dec 6, 2007, 12:40 pm

Thank you!

6_Zoe_
Dec 6, 2007, 2:11 pm

When I sort my catalogue by LCCN, what happens to the books without any data in that field? The first page starts at A and the last page ends at Z, and there's still the right number of pages in the catalogue.

7lorax
Edited: Dec 6, 2007, 2:27 pm

Zoe, blank and invalid LCC sort to the end, and alphanumerically within the blank/invalid data; it just happens that some of your invalid numbers start with Z. (Go look at page 100 of your catalog, if you're showing 20 books per page, and you'll see some of the blanks and the start of the invalids.) Your valid Z will be earlier in the catalog.

(Edit: This means that my kludge of putting in the top-level classification for a few books where I couldn't find a fuller one -- just TX for a cookbook, for instance -- no longer works as desired, but that's a small loss.)

8eromsted
Dec 6, 2007, 2:30 pm

Thank you very much. Looks excellent. Even seems to handle oddball LCCs with more than 4 terms. Not sure why this was caving in, but thanks again.

9_Zoe_
Dec 6, 2007, 2:41 pm

Thanks lorax, I hadn't looked closely enough.

10
Dec 6, 2007, 2:42 pm

This message has been deleted by its author.

11timspalding
Dec 6, 2007, 2:44 pm

The TX issue—should they be counted as valid and sorted to the top?

12nperrin
Dec 6, 2007, 3:06 pm

11: I would like that, myself - I haven't filled in fields like that but now that lorax mentions it I would like to!

13kathrynnd
Dec 6, 2007, 3:37 pm

11>Yes, I would say so, why not? Cookbooks are a good example of books that are unlikely to come with an LC classification number on entry. Better something than nothing, at least the books will be put on the right shelf.

7> so call me addicted -- lorax I searched for your cookbook on Worldcat, ( Worldcat is on my Buy, borrow or swap list, easy to do, just takes one click) found only one library with the book that used LC numbers -- Loyola Notre Dame Library -- the rest all used Dewey.

From the MARC record:

090 __ |a TX837 |b .V45 1999
245 04 |a The vegetarian kitchen / |c consultant editor, Linda Fraser.
260 __ |a London : |b Lorenz, |c 1999.
300 __ |a 416 p. : |b col. ill. ; |c 26 cm.

14eromsted
Dec 6, 2007, 3:44 pm

Just noticed a sort problem.

The first number can have a decimal place (E185.6). Numbers with no decimal place (E185) should come before numbers with a decimal place, instead they are coming at the end.

However, sorting within the decimals is working (E185.8 is before E185.86 is before E185.9).

15timspalding
Dec 6, 2007, 3:44 pm

My worry is that it will be hard to separate out valid from invalid. After all, it tries to valid a valid form and then discards the rest of the line for sorting purposes—so you can put "(provisional)" after the LCC and be fine. It will be hard to get that here. "TX is my favorite state" is not a cookbook followed by a comment."

16melannen
Edited: Dec 6, 2007, 4:18 pm

Thank you so much, Tim! I love you forever and promise not to whine about features for a *least* a month. :D You've just given me the top thing on my Christmas list.

11: I'll put my vote in as another power user who's just been putting in the top-level classification for books I can't find in any catalog. However, I haven't had time to play with this yet - it should sort right as long as there are digits of any kind after the letter code, yes? I'd be okay with that.

The online overview at the LoC website usually has enough data for me to figure out the subclass, too, if I'm not too lazy to look it up, so if making just the letters work is too hard, then class + subclass is fine with me.

17lorax
Dec 6, 2007, 6:18 pm

Tim 15, as with the "multiple spaces" issue, you shouldn't have to worry about accommodating our kludges. I can change those few to TX000 or something to make it work.

18ojchase
Dec 7, 2007, 11:47 pm

OK, so what happened to the name of #10? I've never seen it just not exist before.

19jjwilson61
Dec 8, 2007, 10:03 am

That's what happens when you post when you aren't logged in.

20timspalding
Dec 8, 2007, 11:00 am

Which is hard to do. There's some combination of logging in and out that allows it. I could shut it down very easily, although it strikes me as an interesting symptom.

21WalkerMedia
Dec 8, 2007, 1:59 pm

Oh, thank you, thank you, thank you! I've been a happy Thingamibrarian since November 2005, and this has always been on my list of requested features. I'm sure the formation of the LOC Challenge group helped this feature along. I'm just trying to read more within certain classifications and not the whole thing at the moment. :)

22CouperLibrary
Aug 5, 2023, 4:47 am

>14 eromsted: This sort problem is still occurring. Has there been any discussion on how (ie work-around) or if this can be fixed.

23uhouselibrarian
Jan 13, 3:25 am

came here to say this too about the sorting correctly with decimals re: comments 14 & 22!

24eromsted
Jan 15, 9:54 pm

>22 CouperLibrary:, >23 uhouselibrarian:
This is a very old thread. If you have current examples, I'd suggest making a new thread in Bug Collectors

25gilroy
Jan 16, 5:35 am

>23 uhouselibrarian: Please see the bug(s) listed in the following thread, open since July 2023:
https://www.librarything.com/topic/352322

Sort problems are known.