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

        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.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: