-
Notifications
You must be signed in to change notification settings - Fork 19
/
romanized_variation_node.go
40 lines (33 loc) 路 1021 Bytes
/
romanized_variation_node.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
34
35
36
37
38
39
40
package gedcom
// Indicates the method used in transforming the text to a romanized variation.
//
// These constants can be used for RomanizedVariationNode.Type.Value. The value
// is not limited to these constants. Any user defined value is also valid.
const (
RomanizedVariationTypePinyin = "pinyin"
RomanizedVariationTypeRomaji = "romaji"
RomanizedVariationTypeWadegiles = "wadegiles"
)
// RomanizedVariationNode represents a romanized variation of a superior text
// string.
//
// New in Gedcom 5.5.1.
type RomanizedVariationNode struct {
*SimpleNode
}
// NewRomanizedVariationNode creates a new ROMN node.
func NewRomanizedVariationNode(value string, children ...Node) *RomanizedVariationNode {
return &RomanizedVariationNode{
newSimpleNode(TagRomanized, value, "", children...),
}
}
func (node *RomanizedVariationNode) Type() *TypeNode {
return getType(node)
}
func getType(node Node) *TypeNode {
n := First(NodesWithTag(node, TagType))
if IsNil(n) {
return nil
}
return n.(*TypeNode)
}