Rephraser Text and Spintax

부분 유료
분류별 MP Apis | 업데이트됨 एक महीने पहले | Text Analysis
Health Check

N/A

모든 토론으로 돌아가기

New Endpoint Requested = Spintax decode

Rapid account: Darylledyard
darylledyard
एक वर्ष पहले

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 एक वर्ष पहले

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 एक वर्ष पहले

Hello!

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

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입