Example #1
0
 def test_exact_match_mismatch(self):
     jstring = 'Astrop J'
     self.assertEqual(get_pub_abbreviation(jstring, exact=True), [])
Example #2
0
 def test_exact_match_match(self):
     jstring = 'Astrophysical Journal'
     self.assertEqual(get_pub_abbreviation(jstring, exact=True), [(1, 'ApJ......')])
Example #3
0
 def test_missing_data(self):
     jstring = ''
     self.assertEqual(get_pub_abbreviation(jstring), [])
Example #4
0
 def test_exact_match_match(self):
     jstring = 'Astrophysical Journal'
     self.assertEqual(get_pub_abbreviation(jstring, exact=True), [(1, 'ApJ......')])
Example #5
0
 def test_exact_match_mismatch(self):
     jstring = 'Astrop J'
     self.assertEqual(get_pub_abbreviation(jstring, exact=True), [])
Example #6
0
 def test_missing_data(self):
     jstring = ''
     self.assertEqual(get_pub_abbreviation(jstring), [])
Example #7
0
"""
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)