Translated Python implementation to PHP. Created a RAKE class and moved the Test method out of the object.