2 de abril de 2018

Identificar Emoticones en texto

El siguiente script crea un campo flag que identifica si un texto tiene emoticones. Esta técnica fue publicada originalmente por Stefan Wühl y subida aqui

El resultado seria este:












Preview:
data:
LOAD *, PurgeChar(lower(COMENTARIO),'¡!.,@#$%^&()-_=+[]}{;?¿/><0123456789abcdefghijklmnñopqrstvuwxyzáéíóú ') AS coment_for_emoji;
LOAD * INLINE [
    ID, COMENTARIO
    1, muy Bueno!!!
    2, 👏👏👏👏
    3, Excelete....
    4, 🙌👍👍 excelente
    5, !!VAMOS POR MAS!!!
    6, 👏👏👏👏👏
    7, no puede ser
    8, ►►► ok
];

Left Join(data)
LOAD ID, max(If(Ord>128,1,0)) as OrdFlag Group By ID;
LOAD ID, Ord(Mid(coment_for_emoji,Iterno(),1)) as Ord RESIDENT data
While iterno() <= Len(coment_for_emoji);

DROP Field coment_for_emoji;



...

No hay comentarios: