Instance Method インスタンスメソッド

enumerateTagsInRange:scheme:options:usingBlock:

Enumerates over a given range of the string and calls the specified block for each tag. 文字列のある与えられた範囲に渡って列挙します、そして指定されたブロックを各タグに対して呼び出します。

Declaration 宣言

- (void)enumerateTagsInRange:(NSRange)range 
                      scheme:(NSLinguisticTagScheme)tagScheme 
                     options:(NSLinguisticTaggerOptions)opts 
                  usingBlock:(void (^)(NSLinguisticTag tag, NSRange tokenRange, NSRange sentenceRange, BOOL *stop))block;

Parameters パラメータ

range

The range to analyze. 分析する範囲。

tagScheme

The tag scheme. For possible values, see NSLinguisticTagScheme. タグスキーム。可能な値として、NSLinguisticTagSchemeを見てください。

opts

The linguistic tagger options to use. See NSLinguisticTaggerOptions for possible values. 使用する言語学的タガー(標識付け)オプション。NSLinguisticTaggerOptionsを可能な値として見てください。

block

The block to apply to ranges of the string. その文字列の範囲に適用することになるブロック。

The block takes the following arguments: ブロックは以下の引数をとります:

tag

The located linguistic tag. 発見された言語学的タグ。

tokenRange

The range of the linguistic tag. その言語学的タグの範囲。

sentenceRange

The range of the sentence in which the tag occurs. そこにおいてタグが存在する、文の範囲。

stop 中止

A reference to a Boolean value. The block can set the value to YES to stop further processing of the set. The stop argument is an out-only argument. You should only ever set this Boolean to YES within the block. あるブール値への参照。ブロックは、値をYESに設定することで、それ以上の集合の処理を止めることができます。stop引数は、ひとつの退出専用引数です。あなたは、常に「ブロック」内部でこのブールをYESに設定できるだけであるべきです。

Discussion 議論

This method’s block is called for all tokens intersecting a given range, supplying tags and ranges. The tagger segments the string into sentences and tokens as necessary, and return those ranges along with a tag for any scheme in its array of tag schemes. For example, if the tag scheme is NSLinguisticTagSchemeLexicalClass, the tags specify the part of speech (for word tokens) or the type of whitespace or punctuation (for whitespace or punctuation tokens). If the tag scheme is NSLinguisticTagSchemeLemma, the tags specify the stem form of the word (if known) for each word token. このメソッドの持つブロックは、与えられた範囲と交わる全てのトークンに対して、それらタグと範囲を提供して呼び出されます。そのタガーは、文字列を必要に応じて文とトークンに分割します、そしてそれらの範囲を、タグスキームいくらかからなるそれの配列の中の何らかのスキームに対するあるタグと一緒に、返します。例えば、タグスキームがNSLinguisticTagSchemeLexicalClassならば、タグは品詞(単語トークンに対して)もしくは空白または句読点の型(空白または句読点トークンに対して)を指定します。タグスキームがNSLinguisticTagSchemeLemmaならば、タグは各単語トーキンに対する単語の語幹を(もし知られるならば)指定します。

This is a convenience method for calling the enumerateTagsInRange:unit:scheme:options:usingBlock: method, passing NSLinguisticTaggerUnitWord as the linguistic unit. これは、enumerateTagsInRange:unit:scheme:options:usingBlock:メソッドへの呼び出しを、NSLinguisticTaggerUnitWordを言語学的単位として渡して行うことに対する便宜メソッドです。

See Also 参照

Enumerating Linguistic Tags 言語学的タグを列挙する