def test_exact_match_mismatch(self): jstring = 'Astrop J' self.assertEqual(get_pub_abbreviation(jstring, exact=True), [])
def test_exact_match_match(self): jstring = 'Astrophysical Journal' self.assertEqual(get_pub_abbreviation(jstring, exact=True), [(1, 'ApJ......')])
def test_missing_data(self): jstring = '' self.assertEqual(get_pub_abbreviation(jstring), [])
""" Example script for how to use the reference resolver """ import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from adsutils import get_pub_abbreviation # Try an exact match pubstring = 'Astrophysical Journ' print "Trying an exact match for: %s" % pubstring result = get_pub_abbreviation(pubstring, exact=True) print "Result: %s" % str(result) # First we resolve a journal pubstring = 'Astrophysical Journ' print "Trying a fuzzy match for: %s" % pubstring result = get_pub_abbreviation(pubstring) print "Result: %s" % str(result) # Next we resolve a conference name pubstring = 'American Astronautical Society Meeting' print "Matching: %s" % pubstring result = get_pub_abbreviation(pubstring) print "Result: %s" % str(result)