Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-152

TagSet should detect a tag in both process and skip entries

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5
    • Component/s: .utility, tests
    • Labels:
      None

      Attachments

        Activity

        richardm Richard McCreadie created issue -
        Hide
        craigm Craig Macdonald added a comment -

        Trivial patch:

        Index: src/core/org/terrier/utility/TagSet.java
        ===================================================================
        --- src/core/org/terrier/utility/TagSet.java	(revision 3272)
        +++ src/core/org/terrier/utility/TagSet.java	(working copy)
        @@ -211,7 +211,11 @@
         					whiteList.add(t);
         			for (String t : blackListTags.split("\\s*,\\s*"))
         				if (t.length() > 0)
        +				{
        +					if (whiteList.contains(t))
        +						throw new IllegalArgumentException(prefix+".process" + " and " + prefix+".skip" + " cannot both contain tag " + t);
         					blackList.add(t);
        +				}
         			idTag = ApplicationSetup.getProperty(prefix+".idtag","");
         			docTag = ApplicationSetup.getProperty(prefix+".doctag","");
         			if (!caseSensitive)
        
        
        Show
        craigm Craig Macdonald added a comment - Trivial patch: Index: src/core/org/terrier/utility/TagSet.java =================================================================== --- src/core/org/terrier/utility/TagSet.java (revision 3272) +++ src/core/org/terrier/utility/TagSet.java (working copy) @@ -211,7 +211,11 @@ whiteList.add(t); for (String t : blackListTags.split("\\s*,\\s*")) if (t.length() > 0) + { + if (whiteList.contains(t)) + throw new IllegalArgumentException(prefix+".process" + " and " + prefix+".skip" + " cannot both contain tag " + t); blackList.add(t); + } idTag = ApplicationSetup.getProperty(prefix+".idtag",""); docTag = ApplicationSetup.getProperty(prefix+".doctag",""); if (!caseSensitive)
        Hide
        craigm Craig Macdonald added a comment -

        Trivial fix. Added inital junit test for TagSet as well.

        Show
        craigm Craig Macdonald added a comment - Trivial fix. Added inital junit test for TagSet as well.
        craigm Craig Macdonald made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Rodrygo L. T. Santos [ rodrygo ] Craig Macdonald [ craigm ]
        Resolution Fixed [ 1 ]
        craigm Craig Macdonald made changes -
        Project TREC [ 10010 ] Terrier Core [ 10000 ]
        Key TREC-238 TR-152
        Workflow jira [ 10515 ] Terrier Open Source [ 10545 ]
        Component/s .utility [ 10008 ]
        Component/s tests [ 10006 ]
        Component/s Core [ 10020 ]
        Fix Version/s 3.1 [ 10040 ]
        Fix Version/s 3.1 [ 10021 ]

          People

          • Assignee:
            craigm Craig Macdonald
            Reporter:
            richardm Richard McCreadie
          • Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: