"""simple docstring"""



import os

from ...utils import logging
from .utils import DataProcessor, InputExample


_UpperCamelCase         =		logging.get_logger(__name__)
class 	__UpperCAmelCase						(A__    ):







   '''simple docstring'''





   def __init__( self      ,			snake_case_      ,			snake_case_=None       ):







          '''simple docstring'''


          A__					:    List[str]														= language
          A__					:    Any														= train_language





   def 		lowerCamelCase				( self      ,			snake_case_       ):







          '''simple docstring'''


          A__					:    List[Any]														= self.language if self.train_language is None else self.train_language
          A__					:    List[Any]														= self._read_tsv(os.path.join(_lowerCAmelCase      ,			F'''XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv'''       )       )
          A__					:    Optional[Any]														= []
          for i, line in enumerate(_lowerCAmelCase       ):
                 if i == 0:
                        continue
                 A__					:    Optional[int]														= F'''train-{i}'''
                 A__					:    str														= line[0]
                 A__					:    int														= line[1]
                 A__					:    int														= """contradiction""" if line[2] == """contradictory""" else line[2]
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training input {text_a} is not a string'''       )
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training input {text_b} is not a string'''       )
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training label {label} is not a string'''       )
                 examples.append(InputExample(guid=_lowerCAmelCase      ,			text_a=_lowerCAmelCase      ,			text_b=_lowerCAmelCase      ,			label=_lowerCAmelCase       )       )
          return examples





   def 		lowerCamelCase				( self      ,			snake_case_       ):







          '''simple docstring'''


          A__					:    Union[str, Any]														= self._read_tsv(os.path.join(_lowerCAmelCase      ,			"""XNLI-1.0/xnli.test.tsv"""       )       )
          A__					:    List[Any]														= []
          for i, line in enumerate(_lowerCAmelCase       ):
                 if i == 0:
                        continue
                 A__					:    str														= line[0]
                 if language != self.language:
                        continue
                 A__					:    Optional[Any]														= F'''test-{i}'''
                 A__					:    Tuple														= line[6]
                 A__					:    List[Any]														= line[7]
                 A__					:    List[str]														= line[1]
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training input {text_a} is not a string'''       )
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training input {text_b} is not a string'''       )
                 if not isinstance(_lowerCAmelCase      ,			_lowerCAmelCase       ):
                        raise ValueError(F'''Training label {label} is not a string'''       )
                 examples.append(InputExample(guid=_lowerCAmelCase      ,			text_a=_lowerCAmelCase      ,			text_b=_lowerCAmelCase      ,			label=_lowerCAmelCase       )       )
          return examples





   def 		lowerCamelCase				( self       ):







          '''simple docstring'''


          return ["contradiction", "entailment", "neutral"]





_UpperCamelCase         =		{
    'xnli': XnliProcessor,
}

_UpperCamelCase         =		{
    'xnli': 'classification',
}

_UpperCamelCase         =		{
    'xnli': 3,
}






"""simple docstring"""



def    _A(		lowerCAmelCase       ):
							A__					:    str														= len(lowerCAmelCase       )
							A__					:    List[Any]														= [0] * length
							A__					:    Union[str, Any]														= [[False for i in range(lowerCAmelCase       )] for j in range(lowerCAmelCase       )]
							for i, c in enumerate(lowerCAmelCase       ):
														A__					:    Dict														= i
														for j in range(i + 1       ):
																					if c == string[j] and (i - j < 2 or is_palindromic[j + 1][i - 1]):
																												A__					:    List[str]														= True
																												A__					:    Optional[Any]														= min(lowerCAmelCase ,     0 if j == 0 else (cut[j - 1] + 1)       )
														A__					:    Optional[int]														= mincut
							return cut[length - 1]


if __name__ == "__main__":
				_UpperCamelCase         =		input("Enter the string: ").strip()
				_UpperCamelCase         =		find_minimum_partitions(s)
				print(F'Minimum number of partitions required for the \'{s}\' is {ans}')





