-
Notifications
You must be signed in to change notification settings - Fork 8
/
taghandling.go
33 lines (27 loc) · 1.06 KB
/
taghandling.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package deepl
const (
// DefaultTagHandling is the default tag handling strategy: the translation
// engine does not take tags into account.
DefaultTagHandling TagHandlingStrategy = "default"
// XMLTagHandling makes the API process XML input by extracting text out of
// the structure, splitting it into individual sentences, translating them,
// and placing them back into the XML structure.
XMLTagHandling TagHandlingStrategy = "xml"
// HTMLTagHandling makes the API process HTML input by extracting text out
// of the structure, splitting it into individual sentences, translating
// them, and placing them back into the HTML structure.
HTMLTagHandling TagHandlingStrategy = "html"
)
// TagHandlingStrategy is a `tag_handling` option.
type TagHandlingStrategy string
// Value returns the request value for f.
func (f TagHandlingStrategy) Value() string {
if f == DefaultTagHandling {
return ""
}
return string(f)
}
// String converts the [TagHandlingStrategy] to its string representation.
func (f TagHandlingStrategy) String() string {
return string(f)
}