Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agreement ¶
type Agreement struct { BondPurchase *BondPurchase `` /* 129-byte string literal not displayed */ InterestRateSwap *InterestRateSwap `` /* 132-byte string literal not displayed */ CurrencySwap *CurrencySwap `parser:"| 'a' 'Currency' 'Swap' 'Transaction' 'Agreement' 'defined' 'as' 'follows' ':' @@ )" json:"currencySwap,omitempty"` }
type BondPurchase ¶
type BondPurchase struct { Issuer string `parser:"@Ident 'agrees' 'on' 'issuing' 'and' 'selling'" json:"issuer"` FaceValue Money `parser:"'a' 'bond' 'of' @@" json:"faceValue"` Underwriter string `parser:"'to' @Ident" json:"underwriter"` IssuePrice Money `parser:"'for' @@ '.'" json:"issuePrice"` MaturityDate *Date `parser:"'The' 'aforementioned' 'bond' 'reaches' 'maturity' 'on' 'the' @@ '.'" json:"maturityDate"` Coupons *Coupons `parser:"('The' 'bond' 'pays' 'coupons' @@)?" json:"coupons,omitempty"` }
type Contract ¶
type Contract struct { Parties []Party `parser:"'The' 'parties' ':' @@ ';' 'and' (@@ ';' 'and')* @@ '.'" json:"parties"` Agreements []*Agreement `parser:"@@+" json:"agreements"` Signatures []*Signature `parser:"@@+" json:"signatures"` }
Contract represents a contract with parties, agreements and a signature.
type CurrencySwap ¶
type CurrencySwap struct { EffectiveDate *Date `parser:"'The' 'parties' 'agree' 'on' 'a' 'currency' 'swap' 'transaction' 'effective' 'as' 'of' 'the' @@" json:"effectiveDate"` MaturityDate *Date `parser:"'and' 'termination' 'on' 'the' @@ '.'" json:"maturityDate"` PayerA string `parser:"@Ident 'will' 'pay' 'a'" json:"payerA"` PrincipalA Money `parser:"'principal' 'amount' 'of' @@ ','" json:"principalA"` PayerB string `parser:"'and' 'the' @Ident 'will' 'pay' 'a'" json:"payerB"` PrincipalB Money `parser:"'principal' 'amount' 'of' @@ '.'" json:"principalB"` ImpliedExchangeRate ExchangeRate `parser:"" json:"impliedExchangeRate"` EndExchangeRate *ExchangeRate `` /* 166-byte string literal not displayed */ Interest []*InterestPayment `parser:"@@*" json:"interest,omitempty"` }
type Date ¶
type Date struct { Day int `parser:"@Integer" json:"day"` Month string `parser:"('th' | 'rd' | 'st') 'of' @Ident" json:"month"` Year int `parser:"@Integer" json:"year"` // contains filtered or unexported fields }
Date is a date in the format '1st of September 2022'. It marshals in JSON in the RFC3339 format.
func (*Date) MarshalJSON ¶
type ExchangeRate ¶
type InterestPayment ¶
type InterestPayment struct { Payer string `parser:"@Ident 'will' 'pay' 'a'" json:"payer"` FixedRate float64 `parser:"( 'fixed' 'rate' 'interest' 'of' (@Float | @Integer) '%' " json:"fixedRate"` InitialRate float64 `parser:"| 'floating' 'rate' 'interest' ',' 'initially' 'defined' 'as' (@Float | @Integer) '%' ',' ) " json:"initialRate"` Dates []*Date `parser:"'over' 'the' 'notational' 'amount' 'on' 'the' 'following' 'dates' ':' (@@ ',' | @@ | 'and' @@)+ '.'" json:"dates"` RateOption LongIdent `parser:"('The' 'floating' 'rate' 'option' 'is' @(~'.')+ '.')?" json:"rateOption"` }
type InterestRateSwap ¶
type InterestRateSwap struct { NotationalAmount Money `` /* 155-byte string literal not displayed */ EffectiveDate *Date `parser:"'with' 'an' 'effective' 'date' 'as' 'of' 'the' @@" json:"effectiveDate"` MaturityDate *Date `parser:"'and' 'termination' 'on' 'the' @@ '.'" json:"maturityDate"` Interest []*InterestPayment `parser:"@@+" json:"interest"` }
type LongIdent ¶
type LongIdent string
LongIdent is an identifier that spans across multiple token yieldings.
type Money ¶
type Money struct { Currency string `parser:"@Ident" json:"currency"` Amount MoneyAmount `parser:"(@Money | @Float)" json:"amount"` }
Money represents a monetary amount of a certain currency.
type MoneyAmount ¶
type MoneyAmount float64
MoneyAmount is the the type of a monetary amount.
func (*MoneyAmount) Capture ¶
func (b *MoneyAmount) Capture(values []string) error
type Party ¶
type Party struct { Name LongIdent `parser:"@(~',')+" json:"name"` Identifier string `parser:"',' 'undermentioned' 'as' @Ident" json:"identifier"` }
Party represents a party and its identifier.
type Signature ¶
type Signature struct { Parties []string `parser:"'Signed' 'by' @Ident (',' @Ident)* ('and' @Ident)*" json:"parties"` Date *Date `parser:"'on' 'the' @@ '.'" json:"date"` }
Signature represents a signature parsed from the format 'Signed by <Party>, [<Party>, ...] and <Party> on <Date>.'
The signature does not need the parties per se. They are only used to semantically validate the English text. The marshalled output is a Date object.