diff options
author | Rocky Madden <git@rockymadden.com> | 2013-03-15 11:48:56 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-03-15 11:48:56 -0600 |
commit | 351883a732263bb77a88d805eb9780505ec89023 (patch) | |
tree | 84e0cf8e5abb65af1ed5edfe8686af8f11d139d3 /core/source | |
parent | 67e3526853e89569390723030751202ff8f51c72 (diff) | |
download | stringmetric-351883a732263bb77a88d805eb9780505ec89023.tar.gz stringmetric-351883a732263bb77a88d805eb9780505ec89023.tar.bz2 stringmetric-351883a732263bb77a88d805eb9780505ec89023.zip |
Prior space filter name was more apt. Letter case filter is still better with ignore.
Diffstat (limited to 'core/source')
-rwxr-xr-x | core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala | 8 | ||||
-rwxr-xr-x | core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala (renamed from core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala) | 2 | ||||
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala (renamed from core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala) | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala b/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala index eefef7e..c7871ad 100755 --- a/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala +++ b/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala @@ -31,6 +31,9 @@ object StringFilter { type AsciiNumberOnly = com.rockymadden.stringmetric.filter.AsciiNumberOnlyStringFilter lazy val asciiNumberOnly = new StringFilterDelegate with AsciiNumberOnly + type AsciiSpace = com.rockymadden.stringmetric.filter.AsciiSpaceStringFilter + lazy val asciiSpace = new StringFilterDelegate with AsciiSpace + type AsciiSymbol = com.rockymadden.stringmetric.filter.AsciiSymbolStringFilter lazy val asciiSymbol = new StringFilterDelegate with AsciiSymbol @@ -38,8 +41,5 @@ object StringFilter { lazy val asciiSymbolOnly = new StringFilterDelegate with AsciiSymbolOnly type IgnoreAsciiLetterCase = com.rockymadden.stringmetric.filter.IgnoreAsciiLetterCaseStringFilter - lazy val asciiLetterCase = new StringFilterDelegate with IgnoreAsciiLetterCase - - type IgnoreAsciiSpace = com.rockymadden.stringmetric.filter.IgnoreAsciiSpaceStringFilter - lazy val asciiSpace = new StringFilterDelegate with IgnoreAsciiSpace + lazy val ignoreAsciiLetterCase = new StringFilterDelegate with IgnoreAsciiLetterCase } diff --git a/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala b/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala index 60bc07c..161b9fe 100755 --- a/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala +++ b/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala @@ -3,7 +3,7 @@ package com.rockymadden.stringmetric.filter import com.rockymadden.stringmetric.StringFilter /** Ensures ASCII spaces do not matter. */ -trait IgnoreAsciiSpaceStringFilter extends StringFilter { +trait AsciiSpaceStringFilter extends StringFilter { abstract override def filter(charArray: Array[Char]): Array[Char] = super.filter(charArray.filter(_ != ' ')) abstract override def filter(string: String): String = filter(string.toCharArray).mkString diff --git a/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala index 79ddbb1..6ee45b1 100755 --- a/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala @@ -5,10 +5,10 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class IgnoreAsciiSpaceStringFilterSpec extends ScalaTest { - import IgnoreAsciiSpaceStringFilterSpec.Filter +final class AsciiSpaceStringFilterSpec extends ScalaTest { + import AsciiSpaceStringFilterSpec.Filter - "IgnoreAsciiSpaceStringFilter" should provide { + "AsciiSpaceStringFilter" should provide { "overloaded filter method" when passed { "String with spaces" should returns { "String with spaces removed" in { @@ -32,6 +32,6 @@ final class IgnoreAsciiSpaceStringFilterSpec extends ScalaTest { } } -object IgnoreAsciiSpaceStringFilterSpec { - private final val Filter = new StringFilterDelegate with IgnoreAsciiSpaceStringFilter +object AsciiSpaceStringFilterSpec { + private final val Filter = new StringFilterDelegate with AsciiSpaceStringFilter } |