-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a5d3e2a
commit c00e5ce
Showing
6 changed files
with
39 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,4 +66,4 @@ | |
</profileDesc> | ||
</teiHeader> | ||
<text xml:lang="en"></text> | ||
</TEI> | ||
</TEI> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ | |
|
||
|
||
def test_process_grobid_authors(): | ||
encoding = 'utf-8' | ||
|
||
grobid_response = pkg_resources.resource_string( | ||
__name__, | ||
os.path.join( | ||
|
@@ -107,20 +107,21 @@ def test_process_grobid_authors(): | |
|
||
expected_authors_count = len(expected_authors) | ||
|
||
authors = GrobidAuthors(str(grobid_response, encoding)) | ||
authors = GrobidAuthors(grobid_response) | ||
assert len(authors) == expected_authors_count | ||
assert authors.parse_all() == expected_authors | ||
|
||
|
||
def test_grobid_incomplete_authors(): | ||
encoding = 'utf-8' | ||
|
||
grobid_response = pkg_resources.resource_string( | ||
__name__, | ||
os.path.join( | ||
'fixtures', | ||
'grobid_incomplete_doc.xml' | ||
) | ||
) | ||
|
||
expected_authors = [ | ||
{"parsed_affiliations": None, "author": {"full_name": u"Nandi"}}, | ||
{ | ||
|
@@ -161,38 +162,40 @@ def test_grobid_incomplete_authors(): | |
] | ||
|
||
expected_authors_count = len(expected_authors) | ||
authors = GrobidAuthors(str(grobid_response, encoding)) | ||
authors = GrobidAuthors(grobid_response) | ||
assert len(authors) == expected_authors_count | ||
assert authors.parse_all() == expected_authors | ||
|
||
|
||
def test_grobid_no_authors(): | ||
encoding = 'utf-8' | ||
|
||
grobid_response = pkg_resources.resource_string( | ||
__name__, | ||
os.path.join( | ||
'fixtures', | ||
'grobid_no_authors_doc.xml' | ||
) | ||
) | ||
|
||
expected_authors = [] | ||
expected_authors_count = 0 | ||
authors = GrobidAuthors(str(grobid_response, encoding)) | ||
authors = GrobidAuthors(grobid_response) | ||
assert len(authors) == expected_authors_count | ||
assert authors.parse_all() == expected_authors | ||
|
||
|
||
def test_grobid_empty_author(): | ||
encoding = 'utf-8' | ||
|
||
grobid_response = pkg_resources.resource_string( | ||
__name__, | ||
os.path.join( | ||
'fixtures', | ||
'grobid_no_authors_doc.xml' | ||
'grobid_empty_author_doc.xml' | ||
) | ||
) | ||
|
||
expected_authors = [{'parsed_affiliations': None, 'author': {'full_name': u'Abc, Xyz'}}, {'parsed_affiliations': None, 'author': {'emails': [u'[email protected]'], 'full_name': u'Yzc'}}] | ||
expected_authors_count = 2 | ||
authors = GrobidAuthors(str(grobid_response, encoding)) | ||
authors = GrobidAuthors(grobid_response) | ||
assert len(authors) == expected_authors_count | ||
assert authors.parse_all() == expected_authors |