third_party/tensorflow-text/src/tensorflow_text/python/ops/wordshape_ops.py
def wordshape(input_tensor, pattern, name=None):
  """Determine wordshape features for each input string.

  Args:
    input_tensor: string `Tensor` with any shape.
    pattern: A `tftext.WordShape` or a list of WordShapes.
    name: A name for the operation (optional).

  Returns:
    `<bool>[input_tensor.shape + pattern.shape]`: A tensor where
      `result[i1...iN, j]` is true if `input_tensor[i1...iN]` has the wordshape
      specified by `pattern[j]`.

  Raises:
    ValueError: If `pattern` contains an unknown identifier.
  """
  if isinstance(pattern, WordShape):
    return string_ops.regex_full_match(input_tensor, pattern.value, name)
  elif (isinstance(pattern, (list, tuple)) and
        all(isinstance(s, WordShape) for s in pattern)):
    with ops.name_scope(name, "Wordshape", input_tensor):
      return array_ops.stack([wordshape(input_tensor, s) for s in pattern],
                             axis=-1)
  else:
    raise TypeError(
        "Expected 'pattern' to be a single WordShape or a list of WordShapes.")
Determine wordshape features for each input string.

  Args:
    input_tensor: string `Tensor` with any shape.
    pattern: A `tftext.WordShape` or a list of WordShapes.
    name: A name for the operation (optional).

  Returns:
    `<bool>[input_tensor.shape + pattern.shape]`: A tensor where
      `result[i1...iN, j]` is true if `input_tensor[i1...iN]` has the wordshape
      specified by `pattern[j]`.

  Raises:
    ValueError: If `pattern` contains an unknown identifier.
  
Determine wordshape features for each input string.
Determine wordshape features for each input string .
def wordshape(input_tensor, pattern, name=None):
  if isinstance(pattern, WordShape):
    return string_ops.regex_full_match(input_tensor, pattern.value, name)
  elif (isinstance(pattern, (list, tuple)) and
        all(isinstance(s, WordShape) for s in pattern)):
    with ops.name_scope(name, "Wordshape", input_tensor):
      return array_ops.stack([wordshape(input_tensor, s) for s in pattern],
                             axis=-1)
  else:
    raise TypeError(
        "Expected 'pattern' to be a single WordShape or a list of WordShapes.")
def wordshape ( input_tensor , pattern , name = None ) : if isinstance ( pattern , WordShape ) : return string_ops . regex_full_match ( input_tensor , pattern . value , name ) elif ( isinstance ( pattern , ( list , tuple ) ) and all ( isinstance ( s , WordShape ) for s in pattern ) ) : with ops . name_scope ( name , "Wordshape" , input_tensor ) : return array_ops . stack ( [ wordshape ( input_tensor , s ) for s in pattern ] , axis = - 1 ) else : raise TypeError ( "Expected 'pattern' to be a single WordShape or a list of WordShapes." )
Determine wordshape features for each input string.
Determine wordshape features for each input string .
"""Determine wordshape features for each input string.

  Args:
    input_tensor: string `Tensor` with any shape.
    pattern: A `tftext.WordShape` or a list of WordShapes.
    name: A name for the operation (optional).

  Returns:
    `<bool>[input_tensor.shape + pattern.shape]`: A tensor where
      `result[i1...iN, j]` is true if `input_tensor[i1...iN]` has the wordshape
      specified by `pattern[j]`.

  Raises:
    ValueError: If `pattern` contains an unknown identifier.
  """
`[input_tensor.shape + pattern.shape]`: A tensor where
`result[i1...iN, j]` is true if `input_tensor[i1...iN]` has the wordshape
specified by `pattern[j]`.
` [ input_tensor . shape + pattern . shape ] ` : A tensor where ` result [ i1 ... iN j ] ` is true if ` input_tensor [ i1 ... iN ] ` has the wordshape specified by ` pattern [ j ] ` .
If `pattern` contains an unknown identifier.
If ` pattern ` contains an unknown identifier .
ValueError
input_tensor
string `Tensor` with any shape.
string ` Tensor ` with any shape .
pattern
A `tftext.WordShape` or a list of WordShapes.
A ` tftext . WordShape ` or a list of WordShapes .
name
A name for the operation (optional).
A name for the operation ( optional ) .