Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TREMA-UNH/trec-car-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Dietz committed Feb 12, 2020
2 parents 86445a7 + 59d3327 commit fd746d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
13 changes: 11 additions & 2 deletions .travis.yml
@@ -1,9 +1,18 @@
language: python
python:
- "3.5"
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y maven2 python3-pip
- sudo apt-get install -y maven
python:
- "3.4"
- "3.5"
- "3.6"
- "3.7"
install:
- pip install -r python3/requirements.txt
script:
- pip3 install --user python3/
- pip install python3/
- pushd trec-car-tools-example; mvn install; popd

- curl http://trec-car.cs.unh.edu/datareleases/v2.0/test200.v2.0.tar.xz | tar -xJ
Expand Down
2 changes: 1 addition & 1 deletion python3/test.py
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/env python3

from trec_car.read_data import *
import argparse
Expand Down
8 changes: 6 additions & 2 deletions python3/trec_car/read_data.py
Expand Up @@ -129,7 +129,11 @@ def from_cbor(cbor):
elif typetag == 1: return CategoryPage()
elif typetag == 2: return DisambiguationPage()
elif typetag == 3:
targetPage = cbor[1].decode('ascii')
target = cbor[1]
if type(target) == list: # TODO this is almost certainly wrong
targetPage = target[1]
else:
targetPage = target.decode('ascii')
return RedirectPage(targetPage)
else:
print("Deserialisation error for PageType cbor="+cbor)
Expand Down Expand Up @@ -228,7 +232,7 @@ def default():
def __str__(self):
redirStr = ("" if self.redirectNames is None else (" redirected = "+", ".join([name for name in self.redirectNames])))
disamStr = ("" if self.disambiguationNames is None else (" disambiguated = "+", ".join([name for name in self.disambiguationNames])))
catStr = ("" if self.redirectNames is None else (" categories = "+", ".join([name for name in self.categoryNames])))
catStr = ("" if self.redirectNames is None else (" categories = "+", ".join([name for name in (self.categoryNames or [])])))
inlinkStr = ("" if self.inlinkIds is None else (" inlinks = "+", ".join([name for name in self.inlinkIds])))
# inlinkAnchorStr = str (self.inlinkAnchors)
inlinkAnchorStr = ("" if self.inlinkAnchors is None else \
Expand Down

0 comments on commit fd746d7

Please sign in to comment.