助けてください。
「99285/25 EMERGENCY SE 850.0 650.00 04/05/12」という テキスト があります
INTERPRET 813.44 $36.00 04/05/12 カルロス "
650.00も Money としてタグ付けする必要があります。Gate は$36.00を Money タグとして自動的に取得します。どうやって指定するの?
Imports: { import static gate.Utils.*; }
Phase: Number
Input: Token Number
Options: control = all
Macro: AMOUNT_NUMBER
({Token.kind == number}
(({Token.string == ","}|
{Token.string == "."}
)
{Token.kind == number}
)
Rule: MoneyCurrencyUnit
(
(AMOUNT_NUMBER)
({Number.majorType == currency_unit})
)
:number -->
:number {
{
{kind = "number", rule = "MoneyCurrencyUnit"}
}
catch(InvalidOffsetException e) {
// not possible
throw new LuckyException("Invalid offset from annotation");
}
}
JAPE Grammar を使用するのは初めてです。助けてください。
ありがとうございました。