Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
[QUIZ] Banned Words (#9)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Brian Schröder, post: 4450585"] Hello Group, I propose using def clean?( text ) @clean_calls += 1 @banned_words.each do |word| return false if text.include?(word) end true end in the test filter, because my solution does not work with swedish characters. Trying it with wswedish gives errors when using the regex and no errors when using include?, so I think there must be something weird going on in the regex. James, be shure to include this kind of words in your test-cases, or specify that it is not needed. I do not want to delve deeper into this. Regards, Brian PS: Test 1: Testing with 121430 words and 3 banned words Took 0.564248085021973 seconds Used 567 calls Verified as correct Test 2 Testing with 121430 words and 126 banned words Took 6.52887606620789 seconds Used 5545 calls Verified as correct Test 3 Testing with 3930 words and 28 banned words Took 0.0872080326080322 seconds Used 497 calls Verified as correct [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
[QUIZ] Banned Words (#9)
Top