diff options
Diffstat (limited to 'src/main/scala/reading/models/Book.scala')
-rw-r--r-- | src/main/scala/reading/models/Book.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/scala/reading/models/Book.scala b/src/main/scala/reading/models/Book.scala index 7930a63..836fa19 100644 --- a/src/main/scala/reading/models/Book.scala +++ b/src/main/scala/reading/models/Book.scala @@ -13,7 +13,13 @@ case class Book( ) extends Ordered[Book] { def compare(that: Book) = { def formatTitle(title: String) = - title.toLowerCase.replaceAll("^les ", "").replaceAll("^le ", "") + title + .toLowerCase + .replaceAll("^les ", "") + .replaceAll("^le ", "") + .replaceAll("^l'", "") + .replaceAll("^é", "e") + .replaceAll("^è", "e") formatTitle(this.title).compare(formatTitle(that.title)) } } |