/User/edward/Matched_Amazon_author_handling
Type: /type/page
body: value: Trying to load Amazon data that has a matching LC record. Some rough ideas about how should we handle author records.

Use the `catalog.merge.names.match_name()` method to find if a name from MARC data is the same as a name from Amazon.

Might need to rewrite match_name a bit to handle titles better.

Try each of these steps for each Amazon author:

> If name matches a MARC author, nothing to do.

> If role == 'Author':

> > If name matches a MARC contribution:

> > > If MARC contribution has no role, move them to the author list

> > > If MARC contribution has a role, 'editor' for example, they are probably not an author, and shouldn't be moved to the author list

> > If name doesn't match a MARC author or MARC contribution, add it to open library list of authors. (see 'Adding an author' below)

> If role != 'Author'

> > If name in MARC contribution list:

> > > If MARC contribution has a role, do nothing

> > > If MARC contribution is missing a role, add the role from Amazon

> > If name not in MARC contribution list, add it with the role

## Adding an author

* Search for Amazon style author "John Smith", if found use that
* Search for MARC style author "Smith, John", if a single author found, use that
* Add a new Amazon-style author.

## Promoting contributor to author

* Search Openlibrary for author in the MARC style ("Smith, John") include name and dates in match.

> Matching dates is an interesting question because it is based on string matching. Dates from MARC tend to be just years, but users could've edited them in Open Library into full dates. Infogami like matching only supports wildcards at the end of strings for performance reasons, so it is not possible to search for "*1950". Need to search on just author name, then test the dates on each record to see if they match.
* Search Openlibrary for author in the Amazon style ("John Smith"), use if found
* If no match found add author record to openlibrary with name in the MARC-style (?)

## Difficult cases:

1. [The New Whole Foods Encyclopedia](/b/OL384836M)  by Rebecca Wood. Author has two roles, Author and Illustrator. See <http://www.amazon.com/dp/0140250328>
2. [Penguin Book of More New Zealand Jokes](/b/OL90244M).  Amazon lists three authors, all have 'Editor' as their role. MARC doesn't include any roles. It lists one author and two contributors. Should all three be authors, or all three be contributors? I think authors. See <http://www.amazon.com/dp/0140279962>
3. [Goatperson and other tales](/b/OL6841375M). Amazon lists Michael Leunig as 'Illustrator', LC has 'Michael Leunig' in the author field. Records like this should be left unchanged in the Open Library database. See <http://www.amazon.com/dp/0140291407>
4. [A-Z common symptom answer guide](/b/OL3329282M). Amazon lists two author names that match a single contributor in the MARC data. Need to handle this case.
5. [A rag called happiness](/b/OL1062867M). Single author, "Verma, Nirmal" (OL) should match "Verma" (Amazon). No need to create second author.
6. [Improving reading skills](/b/OL38294M). Single author, "Milan Spears, Deanne." (OL) should match "Deanne Spears" (Amazon)
7. [Contemporary topics 1](/b/OL3557280M). Amazon repeats authors surnames as extra authors. Should detected and handle this.
8. [Memoirs of a beatnik](/b/OL62256M). "Di Prima, Diane. "(OL) should match "Diane DiPrima" (Amazon)
9. [ Life with an idiot](/b/OL3307558M). Different author name transliteration: "Erofeev, V. V." (OL) doesn't match "Victor Erofeyev" (Amazon)
10. [A legend in his own mind](/b/OL1746348M). OL has "Jones, Bob, 1926- ill.", Amazon has "Jones (Author)". Should be matched as same person and kept as an illustrator. 

## Bad matches

1. [Teach Yourself Philosophy](/b/OL3307417M) by Mel Thompson wrongly matches [Philosophy](http://www.amazon.com/dp/0071118659) by Brooke Noel Moore and Kenneth Bruder
2. [Selected Writings](/b/OL6803023M) by Gérard de Nerval wrongly matches [Selected Writings](http://www.amazon.com/dp/0140248420)
by Sandor Ferenczi
title: Matched Amazon author handling