Metaphone key

108 views
Skip to first unread message

Jawa Siva

unread,
Dec 23, 2013, 9:09:07 AM12/23/13
to openr...@googlegroups.com
Is there any GREL/Jython function to access the metaphone key or cluster function to compare two strings?

Thad Guidry

unread,
Dec 23, 2013, 10:39:10 AM12/23/13
to openr...@googlegroups.com
phonetic() and fingerprint() are useful for this purpose, along with other string functions in GREL like ngram() and unicode()


If you need even more power, you can also look at the source of fingerprint() itself and call the Java functions yourself and modify to your liking with GREL (by using Clojure or Jython)

main/src/com/google/refine/clustering/binning/BinningClusterer.java is one of them.



On Mon, Dec 23, 2013 at 8:09 AM, Jawa Siva <rjaw...@gmail.com> wrote:
Is there any GREL/Jython function to access the metaphone key or cluster function to compare two strings?

--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Jawa Siva

unread,
Dec 24, 2013, 12:28:57 AM12/24/13
to openr...@googlegroups.com
Thats cool. Thanks

Marcelo LaFleur

unread,
May 20, 2014, 2:06:02 PM5/20/14
to openr...@googlegroups.com
Hi,
I'm trying to do the same but I cannot get past the following error:

-Add column based on this column-
GREL expression: phonetic(value)  << I want the metaphone3 code as a new column
 Error: phonetic expects 3 strings

From what I can see, phonetic should only look for 2 strings. Every variation of GREL that I input gives me this code.

Help?
PS: new to Refine.

Owen Stephens

unread,
May 21, 2014, 4:33:12 AM5/21/14
to openr...@googlegroups.com
It looks like that the phonetic does not assume a default value for the encoding scheme, although the help says it does.

I get the same error with phonetic(value), but 

phonetic(value,'metaphone3')

works for me 

Owen Stephens
Owen Stephens Consulting
Web: http://www.ostephens.com
Email: ow...@ostephens.com
Telephone: 0121 288 6936

For more options, visit https://groups.google.com/d/optout.

Marcelo LaFleur

unread,
May 21, 2014, 9:58:25 AM5/21/14
to openr...@googlegroups.com
Ah, I was missing the single quotes in the string. Thanks for the help. It works perfectly, though the documentation clearly should be updated (and the error message also).

-- Marcelo


--
You received this message because you are subscribed to a topic in the Google Groups "OpenRefine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openrefine/9wbjmEoZNDo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openrefine+...@googlegroups.com.

Thad Guidry

unread,
May 21, 2014, 3:02:27 PM5/21/14
to openr...@googlegroups.com
I have added the example usage to phonetic() on our wiki reference pages.  https://github.com/OpenRefine/OpenRefine/wiki/GREL-String-Functions#phoneticstring-s-optional-string-encoding

Thanks for letting us know !

Marcelo LaFleur

unread,
May 21, 2014, 3:09:31 PM5/21/14
to openr...@googlegroups.com
Thanks Thad. The documentation should not state that the command defaults to anything. Without the encoding the command returns an error. 

Try:  phonetic(value)

-- Marcelo

Thad Guidry

unread,
May 21, 2014, 6:39:10 PM5/21/14
to openr...@googlegroups.com

Marcelo LaFleur

unread,
May 21, 2014, 6:56:14 PM5/21/14
to openr...@googlegroups.com
Looks great!

-- Marcelo
Reply all
Reply to author
Forward
0 new messages