Bibi
19 Oct 2005 21:04

ujap.bibi
Class ParseMethods

java.lang.Object
  extended byujap.bibi.ParseMethods

public final class ParseMethods
extends Object

static helper methods for parsing and re-formatting entries.

Author:
Ute Platzer

Field Summary
private static Authors authors
           
private static String[][] macros
          macros[.][0] contains the text to be searched, macros[.][1] contains the replacement tex macro
private static boolean macrosInitialized
           
 
Constructor Summary
private ParseMethods()
           
 
Method Summary
static String convertPubmedAuthorsToBibtex(String authors)
          Convert the author String for a given Entry from Pubmed to Bibtex format.
private static void initMacros()
          helper method for macros()
static String pages(String value)
          parse pages (in pubmed format: "1654-62") and return proper value: "1654--1662"
static Object parseAuthorsAsBibtex(String value)
          parse a String containing author names and return an array of this type:
static Object parseAuthorsAsPubmed(String value)
          parse a String containing author names and return an array of this type:
static String replaceMacros(String text)
          find search strings and replace by tex macros, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

authors

private static Authors authors

macros

private static String[][] macros
macros[.][0] contains the text to be searched, macros[.][1] contains the replacement tex macro


macrosInitialized

private static boolean macrosInitialized
Constructor Detail

ParseMethods

private ParseMethods()
Method Detail

pages

public static final String pages(String value)
parse pages (in pubmed format: "1654-62") and return proper value: "1654--1662"


parseAuthorsAsBibtex

public static Object parseAuthorsAsBibtex(String value)
                                   throws IOException
parse a String containing author names and return an array of this type:
 { {firstname, lastname}, {anotherfirstname, anotherlast}, {..., ...} }
 
First, Bibtex format is tried, if this gives an exception, pubmed format is tried. if this doesn't work, either, a single string containing the error message is returned.

Parameters:
value - the string to parse
Returns:
a String[][] array, or a simple string with the error message
Throws:
IOException

parseAuthorsAsPubmed

public static Object parseAuthorsAsPubmed(String value)
                                   throws IOException
parse a String containing author names and return an array of this type:
 { {firstname, lastname}, {anotherfirstname, anotherlast}, {..., ...} }
 
First, Bibtex format is tried, if this gives an exception, pubmed format is tried. if this doesn't work, either, a single string containing the error message is returned.

Parameters:
value - the string to parse
Returns:
a String[][] array, or a simple string with the error message
Throws:
IOException

convertPubmedAuthorsToBibtex

public static final String convertPubmedAuthorsToBibtex(String authors)
                                                 throws ParseException
Convert the author String for a given Entry from Pubmed to Bibtex format.

Parameters:
authors - the authors in pubmed format
Returns:
the authors in bibtex format
Throws:
ParseException

replaceMacros

public static final String replaceMacros(String text)
find search strings and replace by tex macros, e.g. replace "C. elegans" by "\ele".

Parameters:
text - the text to search
Returns:
the modified text

initMacros

private static final void initMacros()
helper method for macros()


Bibi
19 Oct 2005 21:04

Copyright ? 2002-2005 Ute Platzer. All Rights Reserved.