From f663985833f915d70ab5364e515709cbf81b1704 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 26 Jun 2010 16:59:59 +0400 Subject: [PATCH] fixed some errors in tests for tags.tagset... --- pli/tags/tagset.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pli/tags/tagset.py b/pli/tags/tagset.py index a30be1a..72f23c5 100755 --- a/pli/tags/tagset.py +++ b/pli/tags/tagset.py @@ -1,7 +1,7 @@ #======================================================================= __version__ = '''0.4.07''' -__sub_version__ = '''20100626163925''' +__sub_version__ = '''20100626165718''' __copyright__ = '''(c) Alex A. Naanou 2009-''' @@ -98,8 +98,10 @@ Selector operations: select all the object in the current tagset. tagset.relatedtags(*tags) -> set - select the tags related to the given. related tags are those that - also tag the seletced objects. + select the tags related to the given. + + related tags are those that also tag the seletced objects. + i.e. tags sutable for further specialization via .all(...) @@ -1024,15 +1026,19 @@ if __name__ == '__main__': --- # test tagchain functionality... + + words = DictTagSet() words.tags2chain('a', 'b', 'c') -> 'a:b:c' words.chain2tags('a:b:c') -> ('a', 'b', 'c') - ##!!! this breaks... ! words.tag('that', 'T:H:A:T') ! words.tag('this', 'T:H:I:S') + ! words.tag('that', 't', 'h', 'a', 't') + ! words.tag('that', 't', 'h', 'i', 's') + words.tags('that') words.all('A').objects() @@ -1040,11 +1046,10 @@ if __name__ == '__main__': words.chains('A') words.chains('T:H') - ##!!! this should not contain the 'a' object... words.all('T:H:A:T').objects() -> set(['that']) - ##!!! the above yields the same result as this... -## >>> words.all('t', 'h', 'a').objects() + + >>> words.all('t', 'h', 'a').objects() words.all('T:H:I:S').objects() -> set(['this']) -- 2.11.4.GIT