Making optional elements nullable
This commit is contained in:
parent
670ad8bac9
commit
8bc7cf02a5
@ -142,13 +142,13 @@ type JmdictSource struct {
|
|||||||
// a loanword is drawn. It will be coded using the three-letter language
|
// a loanword is drawn. It will be coded using the three-letter language
|
||||||
// code from the ISO 639-2 standard. When absent, the value "eng" (i.e.
|
// code from the ISO 639-2 standard. When absent, the value "eng" (i.e.
|
||||||
// English) is the default value. The bibliographic (B) codes are used.
|
// English) is the default value. The bibliographic (B) codes are used.
|
||||||
Language string `xml:"lang,attr"`
|
Language *string `xml:"lang,attr"`
|
||||||
|
|
||||||
// The ls_type attribute indicates whether the lsource element
|
// The ls_type attribute indicates whether the lsource element
|
||||||
// fully or partially describes the source word or phrase of the
|
// fully or partially describes the source word or phrase of the
|
||||||
// loanword. If absent, it will have the implied value of "full".
|
// loanword. If absent, it will have the implied value of "full".
|
||||||
// Otherwise it will contain "part".
|
// Otherwise it will contain "part".
|
||||||
Type string `xml:"ls_type,attr"`
|
Type *string `xml:"ls_type,attr"`
|
||||||
|
|
||||||
// The ls_wasei attribute indicates that the Japanese word
|
// The ls_wasei attribute indicates that the Japanese word
|
||||||
// has been constructed from words in the source language, and
|
// has been constructed from words in the source language, and
|
||||||
@ -164,12 +164,12 @@ type JmdictGlossary struct {
|
|||||||
// gloss. It will be coded using the three-letter language code from
|
// gloss. It will be coded using the three-letter language code from
|
||||||
// the ISO 639 standard. When absent, the value "eng" (i.e. English)
|
// the ISO 639 standard. When absent, the value "eng" (i.e. English)
|
||||||
// is the default value.
|
// is the default value.
|
||||||
Language string `xml:"lang,attr"`
|
Language *string `xml:"lang,attr"`
|
||||||
|
|
||||||
// The g_gend attribute defines the gender of the gloss (typically
|
// The g_gend attribute defines the gender of the gloss (typically
|
||||||
// a noun in the target language. When absent, the gender is either
|
// a noun in the target language. When absent, the gender is either
|
||||||
// not relevant or has yet to be provided.
|
// not relevant or has yet to be provided.
|
||||||
Gender string `xml:"g_gend"`
|
Gender *string `xml:"g_gend"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type JmdictSense struct {
|
type JmdictSense struct {
|
||||||
|
@ -127,7 +127,7 @@ type JmnedictTranslation struct {
|
|||||||
// code from the ISO 639-2 standard. When absent, the value "eng"
|
// code from the ISO 639-2 standard. When absent, the value "eng"
|
||||||
// (i.e. English) is the default value. The bibliographic (B) codes
|
// (i.e. English) is the default value. The bibliographic (B) codes
|
||||||
// are used.
|
// are used.
|
||||||
Language string `xml:"lang,attr"`
|
Language *string `xml:"lang,attr"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadJmnedict(reader io.Reader) (Jmnedict, map[string]string, error) {
|
func LoadJmnedict(reader io.Reader) (Jmnedict, map[string]string, error) {
|
||||||
|
@ -311,7 +311,7 @@ type KanjidicMeaning struct {
|
|||||||
// The m_lang attribute defines the target language of the meaning. It
|
// The m_lang attribute defines the target language of the meaning. It
|
||||||
// will be coded using the two-letter language code from the ISO 639-1
|
// will be coded using the two-letter language code from the ISO 639-1
|
||||||
// standard. When absent, the value "en" (i.e. English) is implied. [{}]
|
// standard. When absent, the value "en" (i.e. English) is implied. [{}]
|
||||||
Language string `xml:"m_lang,attr"`
|
Language *string `xml:"m_lang,attr"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func LoadKanjidic(reader io.Reader) (Kanjidic, error) {
|
func LoadKanjidic(reader io.Reader) (Kanjidic, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user