-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up the benchmark scripts Added a test and a fix for CTS API Passage regarding siblingsId ( #94 )
- Loading branch information
1 parent
220769f
commit d400f2b
Showing
9 changed files
with
124 additions
and
13 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from MyCapytain.resolvers.cts.api import HttpCTSResolver | ||
from MyCapytain.retrievers.cts5 import CTS | ||
from MyCapytain.common.constants import Mimetypes | ||
|
||
# We set up a resolver which communicates with an API available in Leipzig | ||
resolver = HttpCTSResolver(CTS("http://cts.dh.uni-leipzig.de/api/cts/")) | ||
# We require some metadata information | ||
textMetadata = resolver.getMetadata("urn:cts:latinLit:phi1294.phi002.perseus-lat2") | ||
# Texts in CTS Metadata have one interesting property : its citation scheme. | ||
# Citation are embedded objects that carries information about how a text can be quoted, what depth it has | ||
print(type(textMetadata), [citation.name for citation in textMetadata.citation]) | ||
# Now, we want to retrieve the first line of poem seventy two of the second book | ||
passage = resolver.getTextualNode("urn:cts:latinLit:phi1294.phi002.perseus-lat2", subreference="2.72.1") | ||
# And we want to have its content exported to plain text and have the siblings of this passage (previous and next line) | ||
print(passage.export(Mimetypes.PLAINTEXT), passage.siblingsId) | ||
poemsInBook3 = resolver.getReffs("urn:cts:latinLit:phi1294.phi002.perseus-lat2", subreference="3") | ||
print(poemsInBook3) |
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