Documentation
¶
Overview ¶
Package bobadapter renders the dictionary-neutral Entry IR into Bob's documented toDict structure. Bob-specific compatibility decisions stay here and never rewrite dictionary facts in the IR.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactPOS ¶ added in v1.1.0
CompactPOS applies Bob-only abbreviations. Unknown non-empty labels are preserved verbatim: an unfamiliar publisher category must never disappear.
func ShouldUsePlainFallback ¶ added in v1.1.0
ShouldUsePlainFallback reports whether the selected Bob presentation would be an empty shell around untyped free-form Entry/headword sections. The test is intentionally conservative: long or dense structured entries remain Bob cards, and a single structured record keeps combined mode in Bob as well.
Types ¶
type Dict ¶
type Dict struct {
Word string `json:"word"`
Phonetics []Phonetic `json:"phonetics,omitempty"`
Parts []Part `json:"parts,omitempty"`
Exchanges []Exchange `json:"exchanges,omitempty"`
RelatedWordParts []RelatedWordPart `json:"relatedWordParts,omitempty"`
Additions []Addition `json:"additions,omitempty"`
}
func Render ¶
Render is the single-record convenience renderer. RenderEntrySet owns the presentation implementation so single- and multi-record paths cannot drift.
func RenderEntrySet ¶
RenderEntrySet presents one cached semantic EntrySet. Combined mode renders every record with ordinal labels. Separate mode (and any explicit ordinal) renders one ordinary record plus native related-word sibling navigation.
type MultiRecordMode ¶
type MultiRecordMode string
MultiRecordMode controls only Bob presentation. The service cache always keeps the complete EntrySet, regardless of this value.
const ( MultiRecordSeparate MultiRecordMode = "separate" MultiRecordCombined MultiRecordMode = "combined" )
type Options ¶
type Options struct {
IncludeExamples bool
IncludeExtras bool
MaxExamplesPerSense int
MultiRecordMode MultiRecordMode
RecordOrdinal int
IncludeGrammar bool
}
func DefaultOptions ¶
func DefaultOptions() Options
type RelatedWord ¶
type RelatedWordPart ¶
type RelatedWordPart struct {
Part string `json:"part,omitempty"`
Words []RelatedWord `json:"words"`
}
RelatedWordPart and RelatedWord mirror Bob's documented related-word presentation schema. Means is optional, so cross-references can be expressed without inventing definitions that are not present in the dictionary.