-
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.
- Loading branch information
1 parent
95962a5
commit 15fa4b9
Showing
17 changed files
with
1,434 additions
and
1,119 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
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from MyCapytain.resolvers.cts.api import HttpCTSResolver | ||
from MyCapytain.retrievers.cts5 import CTS | ||
from MyCapytain.common.constants import Mimetypes, NS | ||
|
||
# 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 a passage : passage is now a Passage object | ||
# This is an entry from the Smith Myth Dictionary | ||
# The inner methods will resolve to the URI http://cts.dh.uni-leipzig.de/api/cts/?request=GetPassage&urn=urn:cts:pdlrefwk:viaf88890045.003.perseus-eng1:A.abaeus_1 | ||
# And parse it into interactive objects | ||
passage = resolver.getTextualNode("urn:cts:pdlrefwk:viaf88890045.003.perseus-eng1", "A.abaeus_1") | ||
# We need an export as plaintext | ||
print(passage.export( | ||
output=Mimetypes.PLAINTEXT | ||
)) | ||
""" | ||
Abaeus ( Ἀβαῖος ), a surname of Apollo | ||
derived from the town of Abae in Phocis, where the god had a rich temple. (Hesych. s. v. | ||
Ἄβαι ; Hdt. 8.33 ; Paus. 10.35.1 , &c.) [ L.S ] | ||
""" | ||
# We want to find bibliographic information in the passage of this dictionary | ||
# We need an export as LXML ETREE object to perform XPath | ||
print( | ||
passage.export( | ||
output=Mimetypes.PYTHON.ETREE | ||
).xpath(".//tei:bibl/text()", namespaces=NS, magic_string=False) | ||
) | ||
["Hdt. 8.33", "Paus. 10.35.1"] |
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,24 @@ | ||
from MyCapytain.retrievers.cts5 import CTS | ||
|
||
# We set up a retriever which communicates with an API available in Leipzig | ||
retriever = CTS("http://cts.dh.uni-leipzig.de/api/cts/") | ||
# We require a passage : passage is now a Passage object | ||
passage = retriever.getPassage("urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.1") | ||
# Passage is now equal to the string content of http://cts.dh.uni-leipzig.de/api/cts/?request=GetPassage&urn=urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.1 | ||
print(passage) | ||
|
||
""" | ||
<GetPassage><request><requestName>GetPassage</requestName><requestUrn>urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.1</requestUrn></request> | ||
<reply><urn>urn:cts:latinLit:phi1294.phi002.perseus-lat2:1.1</urn><passage><TEI> | ||
<text n="urn:cts:latinLit:phi1294.phi002.perseus-lat2" xml:id="stoa0045.stoa0"><body> | ||
<div type="edition" n="urn:cts:latinLit:phi1294.phi002.perseus-lat2" xml:lang="lat"> | ||
<div type="textpart" subtype="book" n="1"><div type="textpart" subtype="poem" n="1"> | ||
<head>I</head> | ||
<l n="1">Hic est quem legis ille, quem requiris, </l> | ||
<l n="2">Toto notus in orbe Martialis </l> | ||
<l n="3">Argutis epigrammaton libellis: <pb/></l> | ||
<l n="4">Cui, lector studiose, quod dedisti </l> | ||
<l n="5">Viventi decus atque sentienti, </l> | ||
<l n="6">Rari post cineres habent poetae. </l> | ||
</div></div></div></body></text></TEI></passage></reply> | ||
""" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.