diff options
author | Rocky Madden <git@rockymadden.com> | 2013-03-15 11:39:33 -0600 |
---|---|---|
committer | Rocky Madden <git@rockymadden.com> | 2013-03-15 11:39:33 -0600 |
commit | 67e3526853e89569390723030751202ff8f51c72 (patch) | |
tree | 1342880683977cef26aea9d73739b57927494b95 /core/source | |
parent | 1ba756850a7d06dac4d6a35dd64268fafcf63f54 (diff) | |
download | stringmetric-67e3526853e89569390723030751202ff8f51c72.tar.gz stringmetric-67e3526853e89569390723030751202ff8f51c72.tar.bz2 stringmetric-67e3526853e89569390723030751202ff8f51c72.zip |
More straight forward naming.
Diffstat (limited to 'core/source')
-rwxr-xr-x | core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala | 12 | ||||
-rwxr-xr-x | core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilter.scala (renamed from core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiLetterCaseStringFilter.scala) | 2 | ||||
-rwxr-xr-x | core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala (renamed from core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala) | 2 | ||||
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilterSpec.scala (renamed from core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiLetterCaseStringFilterSpec.scala) | 10 | ||||
-rwxr-xr-x | core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala (renamed from core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala) | 10 |
5 files changed, 18 insertions, 18 deletions
diff --git a/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala b/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala index 2f90fb7..eefef7e 100755 --- a/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala +++ b/core/source/core/scala/com/rockymadden/stringmetric/StringFilter.scala @@ -13,9 +13,6 @@ object StringFilter { type AsciiControlOnly = com.rockymadden.stringmetric.filter.AsciiControlOnlyStringFilter lazy val asciiControlOnly = new StringFilterDelegate with AsciiControlOnly - type AsciiLetterCase = com.rockymadden.stringmetric.filter.AsciiLetterCaseStringFilter - lazy val asciiLetterCase = new StringFilterDelegate with AsciiLetterCase - type AsciiLetterNumber = com.rockymadden.stringmetric.filter.AsciiLetterNumberStringFilter lazy val asciiLetterNumber = new StringFilterDelegate with AsciiLetterNumber @@ -34,12 +31,15 @@ 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 type AsciiSymbolOnly = com.rockymadden.stringmetric.filter.AsciiSymbolOnlyStringFilter 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 } diff --git a/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiLetterCaseStringFilter.scala b/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilter.scala index f9c3aa4..d186630 100755 --- a/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiLetterCaseStringFilter.scala +++ b/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilter.scala @@ -3,7 +3,7 @@ package com.rockymadden.stringmetric.filter import com.rockymadden.stringmetric.StringFilter /** Ensures ASCII letter case-sensitivity does not matter. */ -trait AsciiLetterCaseStringFilter extends StringFilter { +trait IgnoreAsciiLetterCaseStringFilter extends StringFilter { abstract override def filter(charArray: Array[Char]): Array[Char] = super.filter(charArray.map(c => if (c >= 65 && c <= 90) (c + 32).toChar else c)) diff --git a/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala b/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala index 161b9fe..60bc07c 100755 --- a/core/source/core/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilter.scala +++ b/core/source/core/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilter.scala @@ -3,7 +3,7 @@ package com.rockymadden.stringmetric.filter import com.rockymadden.stringmetric.StringFilter /** Ensures ASCII spaces do not matter. */ -trait AsciiSpaceStringFilter extends StringFilter { +trait IgnoreAsciiSpaceStringFilter 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/AsciiLetterCaseStringFilterSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilterSpec.scala index bc9659a..4defbc2 100755 --- a/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiLetterCaseStringFilterSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiLetterCaseStringFilterSpec.scala @@ -5,10 +5,10 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class AsciiLetterCaseStringFilterSpec extends ScalaTest { - import AsciiLetterCaseStringFilterSpec.Filter +final class IgnoreAsciiLetterCaseStringFilterSpec extends ScalaTest { + import IgnoreAsciiLetterCaseStringFilterSpec.Filter - "AsciiLetterCaseStringFilter" should provide { + "IgnoreAsciiLetterCaseStringFilter" should provide { "overloaded filter method" when passed { "String with mixed case" should returns { "String with the same case" in { @@ -36,6 +36,6 @@ final class AsciiLetterCaseStringFilterSpec extends ScalaTest { } } -object AsciiLetterCaseStringFilterSpec { - private final val Filter = new StringFilterDelegate with AsciiLetterCaseStringFilter +object IgnoreAsciiLetterCaseStringFilterSpec { + private final val Filter = new StringFilterDelegate with IgnoreAsciiLetterCaseStringFilter } diff --git a/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala b/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala index 6ee45b1..79ddbb1 100755 --- a/core/source/test/scala/com/rockymadden/stringmetric/filter/AsciiSpaceStringFilterSpec.scala +++ b/core/source/test/scala/com/rockymadden/stringmetric/filter/IgnoreAsciiSpaceStringFilterSpec.scala @@ -5,10 +5,10 @@ import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner @RunWith(classOf[JUnitRunner]) -final class AsciiSpaceStringFilterSpec extends ScalaTest { - import AsciiSpaceStringFilterSpec.Filter +final class IgnoreAsciiSpaceStringFilterSpec extends ScalaTest { + import IgnoreAsciiSpaceStringFilterSpec.Filter - "AsciiSpaceStringFilter" should provide { + "IgnoreAsciiSpaceStringFilter" should provide { "overloaded filter method" when passed { "String with spaces" should returns { "String with spaces removed" in { @@ -32,6 +32,6 @@ final class AsciiSpaceStringFilterSpec extends ScalaTest { } } -object AsciiSpaceStringFilterSpec { - private final val Filter = new StringFilterDelegate with AsciiSpaceStringFilter +object IgnoreAsciiSpaceStringFilterSpec { + private final val Filter = new StringFilterDelegate with IgnoreAsciiSpaceStringFilter } |