Home | Trees | Indices | Help |
|
---|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
EDITOR_PATS =
|
|||
STRIP_PATS =
|
|||
AND_PAT = re.compile(r'\s
|
|||
COLLAPSE_SPACE_RE = re.compile(r'\s
|
|||
PUBLISHER_RES =
|
|||
p =
|
|||
x =
|
|
Clean up a list of names into a more consistent format. Xisbn data can be irregularly formatted, unpredictably including ancillary information. This function attempts to cleans up the author field into a list of consistent author names. For example: >>> n = parse_names ("Leonard Richardson and Sam Ruby.") >>> print (n[0].family == 'Richardson') True >>> print (n[0].given == 'Leonard') True >>> print (not n[0].other) True >>> n = parse_names ("Stephen P. Schoenberger, Bali Pulendran") >>> print (n[0].family == 'Schoenberger') True >>> print (n[0].given == 'Stephen') True >>> print (n[0].other == 'P.') True >>> n = parse_names ("Madonna") >>> print (not n[0].family) True >>> print (n[0].given == 'Madonna') True >>> print (not n[0].other) True
|
Detect whethers names are editors and returns
For example: >>> parse_editing_info ("Leonard Richardson and Sam Ruby.") (False, 'Leonard Richardson and Sam Ruby.') >>> parse_editing_info ("Ann Thomson.") (False, 'Ann Thomson.') >>> parse_editing_info ("Stephen P. Schoenberger, Bali Pulendran, editors.") (True, 'Stephen P. Schoenberger, Bali Pulendran') >>> print parse_editing_info ("Madonna") (False, 'Madonna') |
Parse a string of publisher information. As with author names, publication details are often inconsistently set out, even in bibliographic data. This function attempts to parse out and normalise the details. For example: >>> parse_publisher ('New York: Asia Pub. House, c1979.') ('Asia Pub. House', 'New York', '1979') >>> parse_publisher ('New York : LearningExpress, 1999.') ('LearningExpress', 'New York', '1999') >>> parse_publisher ('HarperTorch') ('HarperTorch', '', '') >>> parse_publisher ('Berkeley Heights, NJ: Enslow Publishers, c2000.') ('Enslow Publishers', 'Berkeley Heights, NJ', '2000')
|
|
EDITOR_PATS
|
STRIP_PATS
|
PUBLISHER_RES
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed May 6 19:43:45 2009 | http://epydoc.sourceforge.net |