"""simple docstring"""

import unittest

from cer import CER


__lowercase    =				CER()






class 		_lowercase (						unittest.TestCase      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Optional[int]				)				->				Union[str, Any]:
													'''simple docstring'''



													__UpperCamelCase							=["White House"]
													__UpperCamelCase							=["white house"]
													# S = 2, D = 0, I = 0, N = 11, CER = 2 / 11
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.18_18_18_18_18				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Tuple				)				->				str:
													'''simple docstring'''



													__UpperCamelCase							=["were wolf"]
													__UpperCamelCase							=["werewolf"]
													# S = 0, D = 0, I = 1, N = 9, CER = 1 / 9
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.1_11_11_11				) < 1E-6				)

													__UpperCamelCase							=["werewolf"]
													__UpperCamelCase							=["weae     wolf"]
													# S = 1, D = 1, I = 0, N = 8, CER = 0.25
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.25				) < 1E-6				)

													# consecutive whitespaces case 1
													__UpperCamelCase							=["were wolf"]
													__UpperCamelCase							=["were               wolf"]
													# S = 0, D = 0, I = 0, N = 9, CER = 0
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.0				) < 1E-6				)

													# consecutive whitespaces case 2
													__UpperCamelCase							=["were   wolf"]
													__UpperCamelCase							=["were               wolf"]
													# S = 0, D = 0, I = 0, N = 9, CER = 0
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.0				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=["werewolf"]
													__UpperCamelCase							=["weaewolf"]
													# S = 1, D = 0, I = 0, N = 8, CER = 0.125
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.1_25				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Union[str, Any]				)				->				Optional[Any]:
													'''simple docstring'''



													__UpperCamelCase							=["werewolf"]
													__UpperCamelCase							=["wereawolf"]
													# S = 0, D = 1, I = 0, N = 8, CER = 0.125
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.1_25				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Tuple				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=["werewolf"]
													__UpperCamelCase							=["wereolf"]
													# S = 0, D = 0, I = 1, N = 8, CER = 0.125
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.1_25				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				Any:
													'''simple docstring'''



													__UpperCamelCase							=["werewolf"]
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertEqual(__lowerCamelCase     , 0.0				)





						def   UpperCAmelCase_ (				self							:    List[str]				)				->				int:
													'''simple docstring'''



													__UpperCamelCase							=["werewolf", "I am your father"]
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertEqual(__lowerCamelCase     , 0.0				)

													__UpperCamelCase							=["werewolf", "I am your father", "doge"]
													__UpperCamelCase							=["werxwolf", "I       am your father", "doge"]
													# S = 1, D = 0, I = 0, N = 28, CER = 1 / 28
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.03_57_14_28				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				Optional[int]:
													'''simple docstring'''



													__UpperCamelCase							=["My hovercraft", "is full of eels"]
													__UpperCamelCase							=["My hovercraft is full", " of eels"]
													# S = 0, D = 0, I = 2, N = 28, CER = 2 / 28
													# whitespace at the front of " of eels" will be strip during preporcessing
													# so need to insert 2 whitespaces
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase     , concatenate_texts=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.07_14_28				) < 1E-6				)





						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				Optional[Any]:
													'''simple docstring'''



													__UpperCamelCase							=["我能吞下玻璃而不伤身体"]
													__UpperCamelCase							=[" 能吞虾玻璃而 不霜身体啦"]
													# S = 3, D = 2, I = 0, N = 11, CER = 5 / 11
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.45_45_45_45_45				) < 1E-6				)

													__UpperCamelCase							=["我能吞下玻璃", "而不伤身体"]
													__UpperCamelCase							=["我    能 吞 下 玻 璃", "而不伤身体"]
													# S = 0, D = 5, I = 0, N = 11, CER = 5 / 11
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertTrue(abs(char_error_rate - 0.45_45_45_45_45_45				) < 1E-6				)

													__UpperCamelCase							=["我能吞下玻璃而不伤身体"]
													__UpperCamelCase							=cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)
													self.assertFalse(__lowerCamelCase     , 0.0				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				List[Any]:
													'''simple docstring'''



													__UpperCamelCase							=[""]
													__UpperCamelCase							=["Hypothesis"]
													with self.assertRaises(__lowerCamelCase				):
																				cer.compute(predictions=__lowerCamelCase     , references=__lowerCamelCase				)


if __name__ == "__main__":
				unittest.main()







def  lowercase_						(						_A     :       Dict		):

      """simple docstring"""




      lowerCamelCase__						:							Optional[Any]       =    len(_A		)
      for _ in range(
          0       ,   int(((no_of_elements - 1) / 2) + 1		)		):  # we don't need to traverse to end of list as
            for j in range(0       ,   no_of_elements - 1		):
                  if (
                      lst[j + 1] < lst[j]
                  ):  # applying bubble sort algorithm from left to right (or forwards)
                        lowerCamelCase__						:							Tuple       =    lst[j + 1]
                        lowerCamelCase__						:							Optional[Any]       =    lst[j]
                        lowerCamelCase__						:							Optional[Any]       =    temp
                  if (
                      lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
                  ):  # applying bubble sort algorithm from right to left (or backwards)
                        lowerCamelCase__						:							Any       =    lst[no_of_elements - 1 - j]
                        lowerCamelCase__						:							List[str]       =    lst[no_of_elements - 2 - j]
                        lowerCamelCase__						:							str       =    temp
      return lst


if __name__ == "__main__":
    print("enter the list to be sorted")
    A :       Optional[int]						=   [int(x) for x in input().split()]  # inputing elements of the list in one line
    A :       Optional[Any]						=   double_sort(lst)
    print("the sorted list is")
    print(sorted_lst)


