Rapid Translate Multi Traduction

फ्रीमियम
द्वारा oussama sibari | अपडेट किया गया לפני 4 ימים | Text Analysis
लोकप्रियता

9.8 / 10

लेटेंसी

414ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Wtf result?

Rapid account: Pixiko
pixiko
לפני שנה

raw curl post
{
“from”: “en”,
“to”: “pt”,
“e”: “”,
“q”: [
“Combine video online | Make own video from any parts”
]
}

result
[
"<i>Combine video online |</i> <b>Combinar vídeo online |</b> <i>Make own video from any parts</i> <b>Faça o próprio vídeo de qualquer parte</b>"
]

WTF?
Where did html tags come from? Where does the original string come from?

Rapid account: Sibaridev
sibaridev Commented לפני שנה

Dear valued client,

We are excited to inform you that we have added a new endpoint Rapid Translate Long Text to our Fast Translator API service that allows you to translate very long texts and especially without HTML tags ( no <i>, no <b> ). Based on your recommendation, we have added this feature to help you translate large amounts of text more easily and accurately.

With this new endpoint, you can now translate very long texts up to +100 000 characters without worrying about any HTML tags interfering with the translation process. We understand how important it is for you to have a smooth and seamless translation experience, and we are confident that this new feature will meet your needs.

We appreciate your feedback and always strive to improve our service to meet your expectations. If you have any questions or feedback regarding this new feature or any other aspect of our service, please do not hesitate to contact us. We are always here to help you.

Thank you for choosing the Fast Translator API service.

Best regards,

Sibari Oussama

Rapid account: Deleted
[deleted] Commented לפני שנה

FYI I created a filter function for this which is required to use this api

const hasBIRegex = new RegExp(’</?(?:b|i)(?😦?: [^<>]*)>|>?)’, ‘i’)
const hasHtml = (text) => typeof text === ‘string’ && text.match(hasBIRegex) !== null

const isIRegex = new RegExp(/<i.?></i>/, ‘gi’)
// this endpoint sends back original in italics and output in bold for some reason, as a result we fix it by removing italics text and removing bold tags
const rapidApiOneFormatting = (text) => {
if (hasHtml(text)) {
let txt = text

// an extra space is added between italic closing and new bold for no reason, remove it
txt = txt.replace(/<\/i>\s+<b>/g, '</i><b>')
const removeMatches = text.match(isIRegex)
removeMatches.forEach((match) => {
  // removing matching strings
  txt = txt.replace(match, '')
})

// remove b and i html tags
txt = txt.replace(/<\/?[bi]>/g, '')

return txt

} else {
return text
}
}

the funny thing is, rapid api, an API PLATFORM doesn’t support code in comments, so the above looks a little off in the regex parts

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें