Rephraser Text and Spintax

FREEMIUM
Por MP Apis | Actualizada 3ヶ月前 | Text Analysis
Popularidad

5.9 / 10

Latencia

752ms

Nivel de servicio

100%

Health Check

N/A

Volver a todas las conversaciones

New Endpoint Requested = Spintax decode

Rapid account: Darylledyard
darylledyard
1年前

Can you get me a decode spintax endpoint? Allow HTML to stay intact or just plain text on input?

This would be a great help.

I just purched and I want to use it in my app.

Daryl

Rapid account: Micaelbh
micaelbh Commented 1年前

We will soon add the endpoint to process the spintax, but you can use the code below to process the spintax in order to choose the available options in javascript:

var text = '{{Hello|Hi|Hola}, How {have you been|are you doing}? ’ + ‘Take care. {{Thanks and|Best} Regards|Cheers|Thanks}’;

var matches, options, random;

var regEx = new RegExp(/{([^{}]+?)}/);

while ((matches = regEx.exec(text)) !== null) {
options = matches[1].split(’|’);
random = Math.floor(Math.random() * options.length);
text = text.replace(matches[0], options[random]);
}

console.log(text);

Rapid account: Micaelbh
micaelbh Commented 1年前

Hello!

Yes, we can, but can you give us an example so we can do the best for you?

Únase a la conversación, añada un comentario a continuación:

Inicie sesió/Regístrese para publicar nuevos comentarios