> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# サンプル 2. Step 22: Portions 要素の作成

> アルファベット、文字数、オフセットによって Serves 要素に関連付けられた Portions Character String 要素を使用して、servings の数を抽出します。

Portions 要素を作成するには、次の手順を実行します。

1. [Character String](/ja/flexi-capture/fls/template/character-chain) 型の要素を作成し、名前を **Portions** にします。
2. Character String タブをクリックします。
3. 必要なアルファベットを設定します。テスト画像から判断すると、アルファベットにはすべての数字と文字 "T"、"t"、"O"、"o" が含まれます。
4. アルファベット文字の Percentage を 1 に設定します。
5. Allow embedded hypotheses ボックスをオフにします。
6. 非アルファベット文字の Percentage を 20 に設定します。
7. Character count field に、あいまいな範囲 `{0, 1, 10, 15}` を指定します。この区間は Character String の長さの推定値です。文字数は 1 ～ 10 であると想定します。この範囲外の仮説にはペナルティが適用されます。
8. Relations タブをクリックします。
9. servings の数は常に "Serves" という単語の右側にあり、"Serves" の右境界から数値の右境界までの距離は 200 ドットを超えないため、次の search constraints を指定します。
   * **Serves** 要素の Right of、Offset = 0
   * **Serves** 要素の Left of、Offset = -200、Reference boundary = right
10. servings の数は常に **Serves** という単語と同じ高さに記載されるため、次の search constraints を追加します。

* **Serves** 要素の Above、Offset = -50
  * **Serves** 要素の Below、Offset = -50
