Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use Unicode properties in generators #78

Merged
merged 1 commit into from

2 participants

@rogerbraun

Is this okay, or should I add a line about where to find documentation about this?

@floere
Owner

No, this is very ok. Coders will be able to find out what it means and learn something in the process, which is good :)
I'll also remove the /i at the end.

Thanks a lot, @rogerbraun!

@floere floere merged commit dcb3fe2 into floere:master
@floere
Owner

Hello, encoding, old friend… invalid character property name {L}: /[^\p{L}\p{N}\s\/\-\_\:\"\&\.]/

This is not a call to action, @rogerbraun, just an explanation why I am not releasing this right now.

@floere floere was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 25, 2012
  1. @rogerbraun
This page is out of date. Refresh to see the latest.
View
6 generators/prototypes/all_in_one/sinatra/app.rb
@@ -44,7 +44,7 @@ def each
#
books_index = Index.new :books do
source { Books.new }
- indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
+ indexing removes_characters: /[^\p{L}\p{N}\s\/\-\_\:\"\&\.]/i,
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\_\:\"\&\/]/
category :title,
@@ -64,7 +64,7 @@ def each
#
books = Search.new books_index do
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
- removes_characters: /[^a-z0-9\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
+ removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\&]+/
@@ -129,4 +129,4 @@ def js path
end
-end
+end
View
6 generators/prototypes/server/sinatra/app.rb
@@ -31,7 +31,7 @@ def each
#
books_index = Index.new :books do
source { Books.new }
- indexing removes_characters: /[^a-z0-9\s\/\-\_\:\"\&\.]/i,
+ indexing removes_characters: /[^\p{L}\p{N}\s\/\-\_\:\"\&\.]/i,
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\_\:\"\&\/]/
category :title,
@@ -51,7 +51,7 @@ def each
#
books = Search.new books_index do
searching substitutes_characters_with: CharacterSubstituters::WestEuropean.new, # Normalizes special user input, Ä -> Ae, ñ -> n etc.
- removes_characters: /[^a-z0-9\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
+ removes_characters: /[^\p{L}\p{N}\s\/\-\_\&\.\"\~\*\:\,]/i, # Picky needs control chars *"~:, to pass through.
stopwords: /\b(and|the|of|it|in|for)\b/i,
splits_text_on: /[\s\/\-\&]+/
boost [:title, :author] => +3,
@@ -66,4 +66,4 @@ def each
results.to_json
end
-end
+end
Something went wrong with that request. Please try again.