* only bibtex format is supported * all tests except test_repo.py and edit test pass * edit and update commands were not updated * removed --format argument from export, only bibtex is supported.main
parent
c692f23054
commit
d3736e257b
@ -1 +1,2 @@
|
||||
--ignore-directory=is:build
|
||||
--ignore-directory=is:pubs.egg-info
|
||||
|
@ -1 +1 @@
|
||||
__version__ = 4
|
||||
__version__ = 4
|
||||
|
@ -0,0 +1,21 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
import os
|
||||
|
||||
import dotdot
|
||||
import fake_env
|
||||
|
||||
from pubs import endecoder, pretty
|
||||
|
||||
from str_fixtures import bibtex_raw0
|
||||
|
||||
class TestPretty(unittest.TestCase):
|
||||
|
||||
def test_oneliner(self):
|
||||
|
||||
decoder = endecoder.EnDecoder()
|
||||
bibdata = decoder.decode_bibdata(bibtex_raw0)
|
||||
pretty.bib_oneliner(bibdata['Page99'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@ -1,91 +1,101 @@
|
||||
from unittest import TestCase
|
||||
import unittest
|
||||
|
||||
import testenv
|
||||
import fixtures
|
||||
from papers.commands.list_cmd import (_check_author_match,
|
||||
import dotdot
|
||||
from pubs.commands.list_cmd import (_check_author_match,
|
||||
_check_field_match,
|
||||
_check_query_block,
|
||||
filter_paper,
|
||||
InvalidQuery)
|
||||
|
||||
from pubs.paper import Paper
|
||||
|
||||
import fixtures
|
||||
|
||||
doe_paper = Paper(fixtures.doe_bibdata)
|
||||
page_paper = Paper(fixtures.page_bibdata)
|
||||
turing_paper = Paper(fixtures.turing_bibdata, metadata=fixtures.turing_metadata)
|
||||
|
||||
class TestAuthorFilter(TestCase):
|
||||
class TestAuthorFilter(unittest.TestCase):
|
||||
|
||||
def test_fails_if_no_author(self):
|
||||
no_doe = fixtures.doe2013.copy()
|
||||
no_doe.bibentry.persons = {}
|
||||
no_doe = doe_paper.deepcopy()
|
||||
no_doe.bibentry['author'] = []
|
||||
self.assertTrue(not _check_author_match(no_doe, 'whatever'))
|
||||
|
||||
def test_match_case(self):
|
||||
self.assertTrue(_check_author_match(fixtures.doe2013, 'doe'))
|
||||
self.assertTrue(_check_author_match(fixtures.doe2013, 'doe',
|
||||
self.assertTrue(_check_author_match(doe_paper, 'doe'))
|
||||
self.assertTrue(_check_author_match(doe_paper, 'doe',
|
||||
case_sensitive=False))
|
||||
|
||||
def test_do_not_match_case(self):
|
||||
self.assertFalse(_check_author_match(fixtures.doe2013, 'dOe'))
|
||||
self.assertFalse(_check_author_match(fixtures.doe2013, 'doe',
|
||||
self.assertFalse(_check_author_match(doe_paper, 'dOe'))
|
||||
self.assertFalse(_check_author_match(doe_paper, 'doe',
|
||||
case_sensitive=True))
|
||||
|
||||
def test_match_not_first_author(self):
|
||||
self.assertTrue(_check_author_match(fixtures.page99, 'wani'))
|
||||
self.assertTrue(_check_author_match(page_paper, 'motwani'))
|
||||
|
||||
def test_do_not_match_first_name(self):
|
||||
self.assertTrue(not _check_author_match(fixtures.page99, 'larry'))
|
||||
self.assertTrue(not _check_author_match(page_paper, 'larry'))
|
||||
|
||||
|
||||
class TestCheckTag(TestCase):
|
||||
class TestCheckTag(unittest.TestCase):
|
||||
pass
|
||||
|
||||
|
||||
class TestCheckField(TestCase):
|
||||
class TestCheckField(unittest.TestCase):
|
||||
|
||||
def test_match_case(self):
|
||||
self.assertTrue(_check_field_match(fixtures.doe2013, 'title', 'nice'))
|
||||
self.assertTrue(_check_field_match(fixtures.doe2013, 'title', 'nice',
|
||||
self.assertTrue(_check_field_match(doe_paper, 'title', 'nice'))
|
||||
self.assertTrue(_check_field_match(doe_paper, 'title', 'nice',
|
||||
case_sensitive=False))
|
||||
self.assertTrue(_check_field_match(fixtures.doe2013, 'year', '2013'))
|
||||
self.assertTrue(_check_field_match(doe_paper, 'year', '2013'))
|
||||
|
||||
def test_do_not_match_case(self):
|
||||
self.assertFalse(_check_field_match(fixtures.doe2013, 'title',
|
||||
self.assertTrue(_check_field_match(doe_paper, 'title',
|
||||
'Title', case_sensitive=True))
|
||||
self.assertFalse(_check_field_match(fixtures.doe2013, 'title', 'nice',
|
||||
self.assertFalse(_check_field_match(doe_paper, 'title', 'nice',
|
||||
case_sensitive=True))
|
||||
|
||||
|
||||
class TestCheckQueryBlock(TestCase):
|
||||
class TestCheckQueryBlock(unittest.TestCase):
|
||||
|
||||
def test_raise_invalid_if_no_value(self):
|
||||
with self.assertRaises(InvalidQuery):
|
||||
_check_query_block(fixtures.doe2013, 'title')
|
||||
_check_query_block(doe_paper, 'title')
|
||||
|
||||
def test_raise_invalid_if_too_much(self):
|
||||
with self.assertRaises(InvalidQuery):
|
||||
_check_query_block(fixtures.doe2013, 'whatever:value:too_much')
|
||||
_check_query_block(doe_paper, 'whatever:value:too_much')
|
||||
|
||||
|
||||
class TestFilterPaper(TestCase):
|
||||
class TestFilterPaper(unittest.TestCase):
|
||||
|
||||
def test_case(self):
|
||||
self.assertTrue (filter_paper(fixtures.doe2013, ['title:nice']))
|
||||
self.assertTrue (filter_paper(fixtures.doe2013, ['title:Nice']))
|
||||
self.assertFalse(filter_paper(fixtures.doe2013, ['title:nIce']))
|
||||
self.assertTrue (filter_paper(doe_paper, ['title:nice']))
|
||||
self.assertTrue (filter_paper(doe_paper, ['title:Nice']))
|
||||
self.assertFalse(filter_paper(doe_paper, ['title:nIce']))
|
||||
|
||||
def test_fields(self):
|
||||
self.assertTrue (filter_paper(fixtures.doe2013, ['year:2013']))
|
||||
self.assertFalse(filter_paper(fixtures.doe2013, ['year:2014']))
|
||||
self.assertTrue (filter_paper(fixtures.doe2013, ['author:doe']))
|
||||
self.assertTrue (filter_paper(fixtures.doe2013, ['author:Doe']))
|
||||
self.assertTrue (filter_paper(doe_paper, ['year:2013']))
|
||||
self.assertFalse(filter_paper(doe_paper, ['year:2014']))
|
||||
self.assertTrue (filter_paper(doe_paper, ['author:doe']))
|
||||
self.assertTrue (filter_paper(doe_paper, ['author:Doe']))
|
||||
|
||||
def test_tags(self):
|
||||
self.assertTrue (filter_paper(fixtures.turing1950, ['tag:computer']))
|
||||
self.assertFalse(filter_paper(fixtures.turing1950, ['tag:Ai']))
|
||||
self.assertTrue (filter_paper(fixtures.turing1950, ['tag:AI']))
|
||||
self.assertTrue (filter_paper(fixtures.turing1950, ['tag:ai']))
|
||||
self.assertTrue (filter_paper(turing_paper, ['tag:computer']))
|
||||
self.assertFalse(filter_paper(turing_paper, ['tag:Ai']))
|
||||
self.assertTrue (filter_paper(turing_paper, ['tag:AI']))
|
||||
self.assertTrue (filter_paper(turing_paper, ['tag:ai']))
|
||||
|
||||
def test_multiple(self):
|
||||
self.assertTrue (filter_paper(fixtures.doe2013,
|
||||
self.assertTrue (filter_paper(doe_paper,
|
||||
['author:doe', 'year:2013']))
|
||||
self.assertFalse(filter_paper(fixtures.doe2013,
|
||||
self.assertFalse(filter_paper(doe_paper,
|
||||
['author:doe', 'year:2014']))
|
||||
self.assertFalse(filter_paper(fixtures.doe2013,
|
||||
self.assertFalse(filter_paper(doe_paper,
|
||||
['author:doee', 'year:2014']))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -1,18 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
|
||||
import testenv
|
||||
import dotdot
|
||||
from pubs.commands.tag_cmd import _parse_tags, _tag_groups
|
||||
|
||||
class TestTag(unittest.TestCase):
|
||||
|
||||
def test_tag_parsing(self):
|
||||
|
||||
self.assertEqual(['+abc', '+def9'], _parse_tags( 'abc+def9'))
|
||||
self.assertEqual(['+abc', '-def9'], _parse_tags( 'abc-def9'))
|
||||
self.assertEqual(['-abc', '-def9'], _parse_tags('-abc-def9'))
|
||||
self.assertEqual(['+abc', '-def9'], _parse_tags('+abc-def9'))
|
||||
self.assertEqual(['+abc', '+def9'], _parse_tags([ 'abc+def9']))
|
||||
self.assertEqual(['+abc', '-def9'], _parse_tags([ 'abc-def9']))
|
||||
self.assertEqual(['-abc', '-def9'], _parse_tags(['-abc-def9']))
|
||||
self.assertEqual(['+abc', '-def9'], _parse_tags(['+abc-def9']))
|
||||
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags('-war+math+romance')))
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags('+math+romance-war')))
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags('math+romance-war')))
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags(['-war+math+romance'])))
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags(['+math+romance-war'])))
|
||||
self.assertEqual(({'math', 'romance'}, {'war'}), _tag_groups(_parse_tags(['math+romance-war'])))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
@article{10.1371_journal.pone.0038236,
|
||||
author = {Caroline Lyon AND Chrystopher L. Nehaniv AND Joe Saunders},
|
||||
journal = {PLoS ONE},
|
||||
publisher = {Public Library of Science},
|
||||
title = {Interactive Language Learning by Robots: The Transition from Babbling to Word Forms},
|
||||
year = {2012},
|
||||
month = {06},
|
||||
volume = {7},
|
||||
url = {http://dx.doi.org/10.1371%2Fjournal.pone.0038236},
|
||||
pages = {e38236},
|
||||
abstract = {<p>The advent of humanoid robots has enabled a new approach to investigating the acquisition of language, and we report on the development of robots able to acquire rudimentary linguistic skills. Our work focuses on early stages analogous to some characteristics of a human child of about 6 to 14 months, the transition from babbling to first word forms. We investigate one mechanism among many that may contribute to this process, a key factor being the sensitivity of learners to the statistical distribution of linguistic elements. As well as being necessary for learning word meanings, the acquisition of anchor word forms facilitates the segmentation of an acoustic stream through other mechanisms. In our experiments some salient one-syllable word forms are learnt by a humanoid robot in real-time interactions with naive participants. Words emerge from random syllabic babble through a learning process based on a dialogue between the robot and the human participant, whose speech is perceived by the robot as a stream of phonemes. Numerous ways of representing the speech as syllabic segments are possible. Furthermore, the pronunciation of many words in spontaneous speech is variable. However, in line with research elsewhere, we observe that salient content words are more likely than function words to have consistent canonical representations; thus their relative frequency increases, as does their influence on the learner. Variable pronunciation may contribute to early word form acquisition. The importance of contingent interaction in real-time between teacher and learner is reflected by a reinforcement process, with variable success. The examination of individual cases may be more informative than group results. Nevertheless, word forms are usually produced by the robot after a few minutes of dialogue, employing a simple, real-time, frequency dependent mechanism. This work shows the potential of human-robot interaction systems in studies of the dynamics of early language acquisition.</p>},
|
||||
number = {6},
|
||||
doi = {10.1371/journal.pone.0038236}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
entries:
|
||||
10.1371_journal.pone.0038236:
|
||||
abstract: <p>The advent of humanoid robots has enabled a new approach to investigating
|
||||
the acquisition of language, and we report on the development of robots
|
||||
able to acquire rudimentary linguistic skills. Our work focuses on early
|
||||
stages analogous to some characteristics of a human child of about 6 to
|
||||
14 months, the transition from babbling to first word forms. We investigate
|
||||
one mechanism among many that may contribute to this process, a key factor
|
||||
being the sensitivity of learners to the statistical distribution of linguistic
|
||||
elements. As well as being necessary for learning word meanings, the acquisition
|
||||
of anchor word forms facilitates the segmentation of an acoustic stream
|
||||
through other mechanisms. In our experiments some salient one-syllable
|
||||
word forms are learnt by a humanoid robot in real-time interactions with
|
||||
naive participants. Words emerge from random syllabic babble through a
|
||||
learning process based on a dialogue between the robot and the human participant,
|
||||
whose speech is perceived by the robot as a stream of phonemes. Numerous
|
||||
ways of representing the speech as syllabic segments are possible. Furthermore,
|
||||
the pronunciation of many words in spontaneous speech is variable. However,
|
||||
in line with research elsewhere, we observe that salient content words
|
||||
are more likely than function words to have consistent canonical representations;
|
||||
thus their relative frequency increases, as does their influence on the
|
||||
learner. Variable pronunciation may contribute to early word form acquisition.
|
||||
The importance of contingent interaction in real-time between teacher
|
||||
and learner is reflected by a reinforcement process, with variable success.
|
||||
The examination of individual cases may be more informative than group
|
||||
results. Nevertheless, word forms are usually produced by the robot after
|
||||
a few minutes of dialogue, employing a simple, real-time, frequency dependent
|
||||
mechanism. This work shows the potential of human-robot interaction systems
|
||||
in studies of the dynamics of early language acquisition.</p>
|
||||
author:
|
||||
- first: Caroline
|
||||
last: Saunders
|
||||
middle: Lyon AND Chrystopher L. Nehaniv AND Joe
|
||||
doi: 10.1371/journal.pone.0038236
|
||||
journal: PLoS ONE
|
||||
month: '06'
|
||||
number: '6'
|
||||
pages: e38236
|
||||
publisher: Public Library of Science
|
||||
title: 'Interactive Language Learning by Robots: The Transition from Babbling
|
||||
to Word Forms'
|
||||
type: article
|
||||
url: http://dx.doi.org/10.1371%2Fjournal.pone.0038236
|
||||
volume: '7'
|
||||
year: '2012'
|
@ -0,0 +1,15 @@
|
||||
|
||||
@article{10.1371/journal.pone.0063400,
|
||||
author = {Martius, , Georg AND Der, , Ralf AND Ay, , Nihat},
|
||||
journal = {PLoS ONE},
|
||||
publisher = {Public Library of Science},
|
||||
title = {Information Driven Self-Organization of Complex Robotic Behaviors},
|
||||
year = {2013},
|
||||
month = {05},
|
||||
volume = {8},
|
||||
url = {http://dx.doi.org/10.1371%2Fjournal.pone.0063400},
|
||||
pages = {e63400},
|
||||
abstract = {<p>Information theory is a powerful tool to express principles to drive autonomous systems because it is domain invariant and allows for an intuitive interpretation. This paper studies the use of the predictive information (PI), also called excess entropy or effective measure complexity, of the sensorimotor process as a driving force to generate behavior. We study nonlinear and nonstationary systems and introduce the time-local predicting information (TiPI) which allows us to derive exact results together with explicit update rules for the parameters of the controller in the dynamical systems framework. In this way the information principle, formulated at the level of behavior, is translated to the dynamics of the synapses. We underpin our results with a number of case studies with high-dimensional robotic systems. We show the spontaneous cooperativity in a complex physical system with decentralized control. Moreover, a jointly controlled humanoid robot develops a high behavioral variety depending on its physics and the environment it is dynamically embedded into. The behavior can be decomposed into a succession of low-dimensional modes that increasingly explore the behavior space. This is a promising way to avoid the curse of dimensionality which hinders learning systems to scale well.</p>},
|
||||
number = {5},
|
||||
doi = {10.1371/journal.pone.0063400}
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
entries:
|
||||
10.1371journal.pone.0063400:
|
||||
abstract: <p>Information theory is a powerful tool to express principles to
|
||||
drive autonomous systems because it is domain invariant and allows for
|
||||
an intuitive interpretation. This paper studies the use of the predictive
|
||||
information (PI), also called excess entropy or effective measure complexity,
|
||||
of the sensorimotor process as a driving force to generate behavior. We
|
||||
study nonlinear and nonstationary systems and introduce the time-local
|
||||
predicting information (TiPI) which allows us to derive exact results
|
||||
together with explicit update rules for the parameters of the controller
|
||||
in the dynamical systems framework. In this way the information principle,
|
||||
formulated at the level of behavior, is translated to the dynamics of
|
||||
the synapses. We underpin our results with a number of case studies with
|
||||
high-dimensional robotic systems. We show the spontaneous cooperativity
|
||||
in a complex physical system with decentralized control. Moreover, a jointly
|
||||
controlled humanoid robot develops a high behavioral variety depending
|
||||
on its physics and the environment it is dynamically embedded into. The
|
||||
behavior can be decomposed into a succession of low-dimensional modes
|
||||
that increasingly explore the behavior space. This is a promising way
|
||||
to avoid the curse of dimensionality which hinders learning systems to
|
||||
scale well.</p>
|
||||
author:
|
||||
- first: Georg
|
||||
last: Ay
|
||||
middle: Martius AND Ralf Der AND Nihat
|
||||
doi: 10.1371/journal.pone.0063400
|
||||
journal: PLoS ONE
|
||||
month: '05'
|
||||
number: '5'
|
||||
pages: e63400
|
||||
publisher: Public Library of Science
|
||||
title: Information Driven Self-Organization of Complex Robotic Behaviors
|
||||
type: article
|
||||
url: http://dx.doi.org/10.1371%2Fjournal.pone.0063400
|
||||
volume: '8'
|
||||
year: '2013'
|
@ -0,0 +1,13 @@
|
||||
@techreport{Page99,
|
||||
number = {1999-66},
|
||||
month = {November},
|
||||
author = {Lawrence Page and Sergey Brin and Rajeev Motwani and Terry Winograd},
|
||||
note = {Previous number = SIDL-WP-1999-0120},
|
||||
title = {The PageRank Citation Ranking: Bringing Order to the Web.},
|
||||
type = {Technical Report},
|
||||
publisher = {Stanford InfoLab},
|
||||
year = {1999},
|
||||
institution = {Stanford InfoLab},
|
||||
url = {http://ilpubs.stanford.edu:8090/422/},
|
||||
abstract = {The importance of a Web page is an inherently subjective matter, which depends on the readers interests, knowledge and attitudes. But there is still much that can be said objectively about the relative importance of Web pages. This paper describes PageRank, a mathod for rating Web pages objectively and mechanically, effectively measuring the human interest and attention devoted to them. We compare PageRank to an idealized random Web surfer. We show how to efficiently compute PageRank for large numbers of pages. And, we show how to apply PageRank to search and to user navigation.}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
entries:
|
||||
Page99:
|
||||
abstract: The importance of a Web page is an inherently subjective matter,
|
||||
which depends on the readers interests, knowledge and attitudes. But there
|
||||
is still much that can be said objectively about the relative importance
|
||||
of Web pages. This paper describes PageRank, a mathod for rating Web pages
|
||||
objectively and mechanically, effectively measuring the human interest
|
||||
and attention devoted to them. We compare PageRank to an idealized random
|
||||
Web surfer. We show how to efficiently compute PageRank for large numbers
|
||||
of pages. And, we show how to apply PageRank to search and to user navigation.
|
||||
author:
|
||||
- first: Lawrence
|
||||
last: Page
|
||||
- first: Sergey
|
||||
last: Brin
|
||||
- first: Rajeev
|
||||
last: Motwani
|
||||
- first: Terry
|
||||
last: Winograd
|
||||
institution: Stanford InfoLab
|
||||
month: November
|
||||
note: Previous number = SIDL-WP-1999-0120
|
||||
number: 1999-66
|
||||
publisher: Stanford InfoLab
|
||||
title: 'The PageRank Citation Ranking: Bringing Order to the Web.'
|
||||
type: techreport
|
||||
url: http://ilpubs.stanford.edu:8090/422/
|
||||
year: '1999'
|
@ -0,0 +1,6 @@
|
||||
@article{10.1371/journal.pone.0063400,
|
||||
author = {Martius, , Georg AND Der, , Ralf AND Ay, , Nihat},
|
||||
journal = {PLoS ONE},
|
||||
publisher = {Public Library of Science},
|
||||
title = {Information Driven Self-Organization of Complex Robotic Behaviors},
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
entries:
|
||||
journal0063400:
|
||||
author:
|
||||
- first: Lawrence
|
||||
last: Page
|
||||
- first: Sergey
|
||||
last: Brin
|
||||
- first: Rajeev
|
||||
last: Motwani
|
||||
- first: Terry
|
||||
last: Winograd
|
||||
journal: PLoS ONE
|
||||
publisher: Public Library of Science
|
||||
title: Information Driven Self-Organization of Complex Robotic Behaviors
|
||||
type: article
|
Loading…
Reference in new issue