Fairslator

부분 유료
분류별 Michal Měchura | 업데이트됨 לפני יום | Translation
인기

7.1 / 10

지연 시간

468ms

서비스 수준

100%

Health Check

N/A

모든 자습서로 돌아가기 (3)

How to work with inline markup in the Fairslator API

The text people put through translators and other kinds of processors are often peppered with inline markup of various kinds, such as HTML tags, XML tags or Markdown formatting codes.

"My brother is <b>very</b> afraid of the dentist."

The Fairslator API makes it possible for you to tell it how to recognize such markup. If you do that, Fairslator will ignore the markup when analyzing the text, and will output the markup unchanged in the rewritten texts.

{
	"sourceText": "You are a {b}very{/b} good laywer.",
	"sourceLang": "en",
	"text": "Sie sind ein {b}sehr{/b} guter Anwalt.",
	"lang": "de",
	"secondPerson": "tf",
	"markupRegex": "{[^}]+}"
}

Output:

"Du bist eine {b}sehr{/b} gute Anwältin."

The field markupRegex is a regular expression which recognizes instances of the markup. Including it in your APi request can sometimes make a great difference. If your text has inline markup but you don’t tell Fairslator how to recognize it, it can become confused thinking those are actual words, misunderstand the text, and rewrite it badly.