KScript ドキュメント
JA

言語

英語から自動翻訳されています。原文は英語です。

KScript.Document

LaTeX の数式を含む論文、報告書、手紙、請求書を作成し、TeX をインストールしなくても PDF、LaTeX、Word、Markdown、HTML で保存できます。

スクリプトの先頭でインポートします:

<import package="KScript.Document" />
import KScript.Document

ルート要素が <KScript.Document> のファイルでは、それが自動的に読み込まれます。

拡張子 .kscript のファイルでは、パッケージ名は import のみに記述してください。KScript.Document { } ではなく Document { } と書いてください。

KScript.Document は PDF と Word ファイルを出力するため、この例はドキュメント内では実行できません。例を .ks.xml ファイルにコピーし、kscript で実行してください。

要素文

#<Abstract>Abstract

タイトルの下に表示される要約です。空行で新しい段落になります。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Abstract>We measure how gliders move.</Abstract>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Abstract "We measure how gliders move."
}

#<Author>Author

所属と電子メールを含む著者です。そのテキストは名前になります。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
affiliationstringを含む{ }勤務先または在籍先です。
emailstringを含む{ }電子メールアドレスです。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Author affiliation="University of Cambridge" email="ada@example.org">Ada Lovelace</Author>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Author(affiliation: 'University of Cambridge', email: 'ada@example.org') "Ada Lovelace"
}

#<Bibliography>Bibliography

[@key] で引用された文献の一覧です。BibTeX ファイル、その中の Source 要素、またはその両方から作成されます。指定しない場合、一覧は末尾に配置されます。

文を保持します。{ } の中に文を保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
pathファイルのパススクリプトからの相対パスで指定する BibTeX (.bib) ファイルです。
titlestringを含む{ }見出しです(既定値は References)。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Paragraph>Life is universal [@berlekamp1982].</Paragraph>
  <Bibliography path="refs.bib" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Paragraph "Life is universal [@berlekamp1982]."
  Bibliography(path: 'refs.bib')
}

#<Code>Code

ソースコードのブロックを等幅フォントで、記述どおりに表示します。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
languagestringを含む{ }言語を指定します(例: python)。Markdown と HTML で使用します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Code language="python">print('Hello')</Code>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Code(language: 'python') "print('Hello')"
}

#<Contents>Contents

目次です。PDF ではページ番号が付きます。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
titlestringを含む{ }見出しです(既定値は Contents)。
depth式何階層まで一覧に含めるかを指定します。2 はセクションと小節を一覧に含めます(既定値は 3)。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Contents depth="2" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Contents(depth: 2)
}

#<KScript.Document>Document

ドキュメントです。その内容(Section、Paragraph、List、Table、Figure、Math など)はテンプレートによって配置され、where: で指定した場所、または into: で指定した場所に保存されます。for、if、let などの文もその中で使用できます。

文を保持します。文を { } 内に保持します。 スクリプトのみ。

属性オプション値説明
templateplain|paper|report|letter|invoice見た目を指定します。plain(既定値)、paper、report、letter、invoice から選べます。
titlestringを含む{ }ドキュメントのタイトルです。
subtitlestringを含む{ }タイトルの下に表示される罫線です。
authorstringを含む{ }著者です。複数の場合は ; で区切ります(Author 要素で所属と電子メールを追加できます)。
datestringを含む{ }タイトルの下に表示される日付です(例: { @now()->format('d MMMM yyyy') })。
keywordsstringを含む{ }キーワードのリストです: ['cellular automata', 'Game of Life'](XML では cellular automata, Game of Life)。要約の下に表示され、ファイルのプロパティにも保存されます。
tostringを含む{ }保存先を拡張子で指定します。例: paper.pdf、paper.tex、paper.docx、paper.md、paper.html。リストで複数の形式を指定できます: [paper.pdf, paper.docx]。
into新しい変数の名前後で ->save()、->pages()、->convert(to: markdown) に使用するため、ドキュメントを受け取る変数です。
papera4 | a3 | a5 | b5 | letter | legal用紙サイズです。a4(既定値)、a3、a5、b5、letter、legal のほか、'15cm x 20cm' のようなサイズを指定できます。
landscapetrue または falsetrue にすると用紙を横向きにします。
marginstringを含む{ }余白です。1 つの値(2.5cm)、または CSS のように top/right/bottom/left で指定します(例: '2cm 2.5cm')。
fontserif|sans|mono本文の書体です。serif(Times)、sans(Helvetica)、mono(Courier)から選べます。
heading_fontserif|sans|mono見出しの書体です。serif、sans、mono から選べます。
sizestringを含む{ }本文の文字サイズ(ポイント)です(例: 11)。
line_heightstringを含む{ }ベースラインからベースラインまでの間隔を文字サイズの倍数で指定します(例: 1.4)。
alignjustify|left|center|right本文の揃えです。justify、left、center、right から選べます。
accentstringを含む{ }見出しとタイトルページの色です。'#1f4e79' または 'navy' のような色名で指定します。
numberedtrue または falsefalse にするとセクションに番号を付けません。
title_pagetrue または falsetrue にすると、タイトル、著者、日付、要約を独立したページに配置します。
chapterstrue または falsetrue にすると、最上位の各セクションを新しいページから始めます。
citationsnumeric|author-yearnumeric([1])または author-year((Conway, 1970))から選べます。
headerstringを含む{ }ページヘッダーです。'左 | 中央 | 右' の形式で、[page]、[pages]、[title]、[author]、[date] を使用できます。
footerstringを含む{ }ページフッターです。ヘッダーと同じ形式です。既定値はページ番号を表示します。
rulesbooktabs|grid|none表の罫線です。booktabs(上、下、ヘッダーの下)、grid、none から選べます。
languagestringを含む{ }Word と HTML で使用する言語です(例: en や en-GB)。
例
<KScript.Document template="paper" title="Gliders" author="Ada Lovelace" to="gliders.pdf">
  <Section title="Introduction">
    <Paragraph>A glider moves one cell every \( 4 \) generations.</Paragraph>
  </Section>
</KScript.Document>
import KScript.Document

Document(template: paper, title: 'Gliders', author: 'Ada Lovelace', to: 'gliders.pdf') {
  Section(title: 'Introduction') {
    Paragraph "A glider moves one cell every \( 4 \) generations."
  }
}

#<Figure>Figure

キャプション付きの画像(PNG または JPEG)です。キャプションのある図には番号が付きます。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
path 必須ファイルのパススクリプトからの相対パスで指定する画像です。
captionstringを含む{ }キャプションです。下に「図 1: ...」の形式で表示されます。
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
width式本文幅に対する割合を 0 から 1 の値(または '60%')で指定します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Figure path="glider.png" caption="A glider" id="fig-glider" width="0.5" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Figure(path: 'glider.png', caption: 'A glider', id: 'fig-glider', width: 0.5)
}

#<Invoice>Invoice

請求書です。差出人と宛先の住所、請求書番号と日付、小計・税額・合計を含む品目の表、備考を記載します。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
items 必須式明細行です。description、quantity(既定値は 1)、price(または amount)を含むマップのリストです。
numberstringを含む{ }請求書番号。
fromstringを含む{ }お客様の氏名と住所(1行ずつ)。
tostringを含む{ }お客様の氏名と住所。
datestringを含む{ }請求書の日付(既定値:本日)。
duestringを含む{ }お支払い期限。
currencystringを含む{ }通貨コード(GBP、USD、EUR、JPYなど)または記号(既定値:GBP)。
tax式税率(パーセント、例:20)。税の行を表示しない場合は省略してください。
tax_namestringを含む{ }税の名称(既定値:VAT)。
paid式既に支払い済みの金額。残高とともに表示されます。
notesstringを含む{ }表の下に表示される支払い情報または条件。
titlestringを含む{ }見出し(既定値:Invoice)。
例
<KScript.Document template="invoice" to="invoice.pdf">
  <Invoice number="INV-042" from="Life Lab Ltd\n1 High Street" to="Acme plc\n2 Low Road" currency="GBP" tax="20" items="[{ description: 'Consulting', quantity: 3, price: 450 }]" />
</KScript.Document>
import KScript.Document

Document(template: invoice, to: 'invoice.pdf') {
  Invoice(number: 'INV-042', from: 'Life Lab Ltd\n1 High Street', to: 'Acme plc\n2 Low Road', currency: 'GBP', tax: 20, items: [{ description: 'Consulting', quantity: 3, price: 450 }])
}

#<Item>Item

リストの項目。そのテキストはParagraphと同様に扱われます。

{ }の値を含むテキスト。スクリプトのみ。<List>Listの中に配置します。

例
<KScript.Document title="Gliders" to="gliders.pdf">
  <List>
    <Item>Gliders move by **one cell** diagonally.</Item>
  </List>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  List {
    Item "Gliders move by **one cell** diagonally."
  }
}

#<Latex>Latex

テキスト、latexの値、または.texファイルから読み込まれるLaTeX。文書の一部と同じように読み込まれます:セクション、段落、リスト、数式、引用、図、一般的なテキストコマンドなど。テキストはそのまま使用されるため、波括弧はLaTeXのものです。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
pathファイルのパススクリプトからの相対パスで指定する.texファイル。
value式LaTeXブロックを返す関数などが生成するlatexの値。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Latex path="chapters/method.tex" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Latex(path: 'chapters/method.tex')
}

#<Letter>Letter

手紙:右側に差出人の住所と日付、宛先、件名、挨拶、本文、結びの言葉、署名。

文を保持します。{ } の中に文を保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
fromstringを含む{ }差出人の氏名と住所(1行ずつ)。
tostringを含む{ }宛先の氏名と住所(1行ずつ)。
datestringを含む{ }日付(既定値:本日、例:2026年11月20日)。
subjectstringを含む{ }太字で表示される件名。
openingstringを含む{ }「Dear Sam,」のような挨拶文。
closingstringを含む{ }「Yours sincerely,」のような結びの言葉。
signaturestringを含む{ }結びの言葉の下に表示される氏名。必要に応じて役職用の行を含めることができます。
例
<KScript.Document template="letter" to="letter.pdf">
  <Letter from="1 High Street\nCambridge" to="Sam Smith\n2 Low Road\nLeeds" subject="Your order" opening="Dear Sam," closing="Best wishes," signature="Ada">
    <Paragraph>Thank you for your order.</Paragraph>
  </Letter>
</KScript.Document>
import KScript.Document

Document(template: letter, to: 'letter.pdf') {
  Letter(from: '1 High Street\nCambridge', to: 'Sam Smith\n2 Low Road\nLeeds', subject: 'Your order', opening: 'Dear Sam,', closing: 'Best wishes,', signature: 'Ada') {
    Paragraph "Thank you for your order."
  }
}

#<List>List

Item要素による箇条書きまたは番号付きリスト。Itemの直後にあるListはそのItemの中にネストされます。

文を保持します。{ } の中に文を保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
stylebullet|'number'|letter|romanbullet(既定値)、number、letter、またはroman。
start式最初の番号(例:3)。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <List style="number">
    <Item>Measure</Item>
    <Item>Compare</Item>
  </List>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  List(style: number) {
    Item "Measure"
    Item "Compare"
  }
}

#<Markdown>Markdown

テキストまたはファイルから読み込まれるMarkdown。#の見出しはセクションになり、段落、リスト、表、コード、引用、画像、数式を含めることができます(スクリプトでは[ ]、ファイルでは$ \(and\) $$も使用可能)。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
pathファイルのパススクリプトからの相対パスで指定するMarkdownファイル。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Markdown path="chapters/results.md" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Markdown(path: 'chapters/results.md')
}

#<Math>Math

LaTeXで記述された番号付きの数式。numbered: falseでない限り番号が付きます。テキストはそのまま使用されるため、波括弧はLaTeXのものです。matrix、cases、alignedの内部では、改行によって行が区切られます。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
numberedtrue または falsefalseを指定すると数式番号を付けません。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Math id="eq-growth">N(t) = N_0 e^{rt}</Math>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Math(id: 'eq-growth') "N(t) = N_0 e^{rt}"
}

#<PageBreak>PageBreak

新しいページを開始します。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

例
<KScript.Document title="Gliders" to="gliders.pdf">
  <PageBreak />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  PageBreak
}

#<Paragraph>Paragraph

段落。テキストには太字、斜体、code、リンク、( 数式 )、[@key]による引用、[#id]による相互参照、^[脚注]を含めることができます。空行で新しい段落が始まります。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
alignleft|center|right|justifyleft、center、right、justifyのいずれか(既定値は文書の設定)。
linestrue または falsetrueの場合、住所や詩のように、テキスト内の改行を保持します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Paragraph>Gliders travel **diagonally**, one cell every \( 4 \) generations.^[Down and to the right.]</Paragraph>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Paragraph "Gliders travel **diagonally**, one cell every \( 4 \) generations.^[Down and to the right.]"
}

#<Quote>Quote

引用文。左右の余白から字下げして組まれます。

{ } の値を持つテキストを保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
bystringを含む{ }誰の発言かを示します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Quote by="John Conway">I hate the Game of Life.</Quote>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Quote(by: 'John Conway') "I hate the Game of Life."
}

#<Rule>Rule

テキストを横切る水平線。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Rule />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Rule
}

#<Section>Section

番号付きの見出しを持つセクション。Section内のSectionはサブセクションになります。

文を保持します。{ } の中に文を保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
title 必須stringを含む{ }見出し。太字、斜体、( 数式 )を含めることができます。
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
numberedtrue または falsefalseを指定するとこのセクションに番号を付けません。
new_pagetrue または falsetrueを指定するとこのセクションを新しいページから開始します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Section title="Methods" id="methods">
    <Paragraph>We ran each pattern for 1000 generations.</Paragraph>
  </Section>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Section(title: 'Methods', id: 'methods') {
    Paragraph "We ran each pattern for 1000 generations."
  }
}

#<Source>Source

引用する文献を完全な形で記述します。id:は[@key]で使用するキーで、その他の属性はBibTeXのフィールド(author、title、year、journal、volume、pages、publisher、url、doiなど)です。

自己終了タグ。単独の記述。 スクリプトのみ。<Bibliography>Bibliographyの中に配置します。その他の属性は出典の追加フィールドで、journal、volume、pages、url、doiなどです。その他のオプションは出典の追加フィールドで、journal、volume、pages、url、doiなどです。

属性オプション値説明
id 必須stringを含む{ }[@conway1970]のような引用キー。
typea stringarticle、book、inproceedings、miscなど。
authorstringを含む{ }BibTeXと同様に' and 'で区切った著者名。
titlestringを含む{ }タイトル。
yearstringを含む{ }発行年。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Paragraph>Life was first described in 1970 [@gardner1970].</Paragraph>
  <Bibliography>
    <Source id="gardner1970" type="article" author="Martin Gardner" title="Mathematical Games" journal="Scientific American" year="1970" volume="223" pages="120--123" />
  </Bibliography>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Paragraph "Life was first described in 1970 [@gardner1970]."
  Bibliography {
    Source(id: 'gardner1970', type: 'article', author: 'Martin Gardner', title: 'Mathematical Games', journal: 'Scientific American', year: 1970, volume: 223, pages: '120--123')
  }
}

#<Table>Table

表:rows:から、または内部のTr行から作成されます。キャプションのある表には番号が付きます。端末の表と同じrows、columns、align、headerを受け付けます。

文を保持します。{ } の中に文を保持します。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
captionstringを含む{ }表の上に「Table 1: ...」として表示されるキャプション。
idstringを含む{ }[#id] による相互参照のための名前です(例: id: "intro")。
rows式行:各要素がマップ(1行)であるリスト、またはリストのリスト(最初のリストが見出し行)。
columns式各マップのどの値をどの順序で表示するか:キーのリスト['name', 'age']、または見出しからキーへのマップ{ Name: 'name' }。既定値は最初の行のキーです。
align式各列の配置としてleft、center、right(例:['left', 'right'])。数値は既定で右揃えになります。
widths式ページ全体での表の相対的な列幅(例:[3, 1, 1])。
rulesbooktabs|grid|nonebooktabs、grid、またはnone(既定値は文書の設定)。
headertrue または falsefalseの場合、見出し行を表示しません。
size式本文に対する相対的な文字サイズ(例:0.9)。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Table caption="Patterns" rows="$patterns" columns="{ Pattern: 'name', Period: 'period' }" align="['left', 'right']" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Table(caption: 'Patterns', rows: $patterns, columns: { Pattern: 'name', Period: 'period' }, align: ['left', 'right'])
}

#<Tr>Tr

テーブルの行。セルは | で区切られ、各セルは段落のテキストと同様です。セル内の | は | と表示されます。

{ } の値を含むテキスト。スクリプト専用です。<Table>Table の中に配置します。

属性オプション値説明
headertrue または falsetrue にすると見出し行になり、各ページの先頭に繰り返し表示されます。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <Table caption="Patterns">
    <Tr header="true">Pattern | Period | Speed</Tr>
    <Tr>Glider | 4 | c/4</Tr>
  </Table>
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  Table(caption: 'Patterns') {
    Tr(header: true) "Pattern | Period | Speed"
    Tr "Glider | 4 | c/4"
  }
}

#<VSpace>VSpace

縦方向の余白。

自己終了タグです。単独の文です。スクリプトでのみ使用します。<KScript.Document>Document または <fn>fn の中に記述します。

属性オプション値説明
height 必須stringを含む{ }量。'12pt'、'5mm'、'1cm' などの長さを指定します。
例
<KScript.Document title="Gliders" to="gliders.pdf">
  <VSpace height="1cm" />
</KScript.Document>
import KScript.Document

Document(title: 'Gliders', to: 'gliders.pdf') {
  VSpace(height: '1cm')
}

コマンド

コマンドは任意の式の中で@を使って呼び出します:@name(arguments)。

#@document(text, as?: 'markdown'|'latex') → document

Markdown または LaTeX のソースからドキュメントを作成します。フェンス付きの値は形式を指定します。プレーンな文字列の既定値は Markdown です。
パラメーター受け取るもの
text 必須任意の値
as 省略可次のいずれかの語: 'markdown'|'latex'

引数には名前を付けられます: @document(…, as: …)。

例
<echo>{ @document('# Notes')->save('notes.pdf') }</echo>
echo @document('# Notes')->save('notes.pdf')

#@document_templates() → map

組み込みのドキュメントテンプレートと、それぞれの用途: { paper: '...', report: '...' }。
例
<echo>{ @document_templates()->keys() }</echo>
echo @document_templates()->keys()

#@latex_escape(text) → string

Text made safe to put in a LaTeX file: \ $ & % # _ ~ ^ escaped.
例
<echo>{ @latex_escape('50% of $10 &amp; up') }</echo>
echo @latex_escape('50% of $10 & up')

メソッド

markdown の値: ->find()、->replace()、->insert()、->save()、->pages()、->words()

latex の値: ->find()、->replace()、->insert()、->save()、->pages()、->words()

document の値: ->save()、->bytes()、->find()、->replace()、->insert()、->pages()、->words()