__init__.pyi 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. # Generated content DO NOT EDIT
  2. class Normalizer:
  3. """
  4. Base class for all normalizers
  5. This class is not supposed to be instantiated directly. Instead, any implementation of a
  6. Normalizer will return an instance of this class when instantiated.
  7. """
  8. def __getstate__(self):
  9. """ """
  10. pass
  11. def __setstate__(self, state):
  12. """ """
  13. pass
  14. @staticmethod
  15. def custom(normalizer):
  16. """ """
  17. pass
  18. def normalize(self, normalized):
  19. """
  20. Normalize a :class:`~tokenizers.NormalizedString` in-place
  21. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  22. keep track of the alignment information. If you just want to see the result
  23. of the normalization on a raw string, you can use
  24. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  25. Args:
  26. normalized (:class:`~tokenizers.NormalizedString`):
  27. The normalized string on which to apply this
  28. :class:`~tokenizers.normalizers.Normalizer`
  29. """
  30. pass
  31. def normalize_str(self, sequence):
  32. """
  33. Normalize the given string
  34. This method provides a way to visualize the effect of a
  35. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  36. information. If you need to get/convert offsets, you can use
  37. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  38. Args:
  39. sequence (:obj:`str`):
  40. A string to normalize
  41. Returns:
  42. :obj:`str`: A string after normalization
  43. """
  44. pass
  45. class BertNormalizer(Normalizer):
  46. """
  47. BertNormalizer
  48. Takes care of normalizing raw text before giving it to a Bert model.
  49. This includes cleaning the text, handling accents, chinese chars and lowercasing
  50. Args:
  51. clean_text (:obj:`bool`, `optional`, defaults to :obj:`True`):
  52. Whether to clean the text, by removing any control characters
  53. and replacing all whitespaces by the classic one.
  54. handle_chinese_chars (:obj:`bool`, `optional`, defaults to :obj:`True`):
  55. Whether to handle chinese chars by putting spaces around them.
  56. strip_accents (:obj:`bool`, `optional`):
  57. Whether to strip all accents. If this option is not specified (ie == None),
  58. then it will be determined by the value for `lowercase` (as in the original Bert).
  59. lowercase (:obj:`bool`, `optional`, defaults to :obj:`True`):
  60. Whether to lowercase.
  61. """
  62. def __init__(self, clean_text=True, handle_chinese_chars=True, strip_accents=None, lowercase=True):
  63. pass
  64. def __getstate__(self):
  65. """ """
  66. pass
  67. def __setstate__(self, state):
  68. """ """
  69. pass
  70. @property
  71. def clean_text(self):
  72. """ """
  73. pass
  74. @clean_text.setter
  75. def clean_text(self, value):
  76. """ """
  77. pass
  78. @staticmethod
  79. def custom(normalizer):
  80. """ """
  81. pass
  82. @property
  83. def handle_chinese_chars(self):
  84. """ """
  85. pass
  86. @handle_chinese_chars.setter
  87. def handle_chinese_chars(self, value):
  88. """ """
  89. pass
  90. @property
  91. def lowercase(self):
  92. """ """
  93. pass
  94. @lowercase.setter
  95. def lowercase(self, value):
  96. """ """
  97. pass
  98. def normalize(self, normalized):
  99. """
  100. Normalize a :class:`~tokenizers.NormalizedString` in-place
  101. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  102. keep track of the alignment information. If you just want to see the result
  103. of the normalization on a raw string, you can use
  104. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  105. Args:
  106. normalized (:class:`~tokenizers.NormalizedString`):
  107. The normalized string on which to apply this
  108. :class:`~tokenizers.normalizers.Normalizer`
  109. """
  110. pass
  111. def normalize_str(self, sequence):
  112. """
  113. Normalize the given string
  114. This method provides a way to visualize the effect of a
  115. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  116. information. If you need to get/convert offsets, you can use
  117. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  118. Args:
  119. sequence (:obj:`str`):
  120. A string to normalize
  121. Returns:
  122. :obj:`str`: A string after normalization
  123. """
  124. pass
  125. @property
  126. def strip_accents(self):
  127. """ """
  128. pass
  129. @strip_accents.setter
  130. def strip_accents(self, value):
  131. """ """
  132. pass
  133. class ByteLevel(Normalizer):
  134. """
  135. Bytelevel Normalizer
  136. """
  137. def __init__(self):
  138. pass
  139. def __getstate__(self):
  140. """ """
  141. pass
  142. def __setstate__(self, state):
  143. """ """
  144. pass
  145. @staticmethod
  146. def custom(normalizer):
  147. """ """
  148. pass
  149. def normalize(self, normalized):
  150. """
  151. Normalize a :class:`~tokenizers.NormalizedString` in-place
  152. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  153. keep track of the alignment information. If you just want to see the result
  154. of the normalization on a raw string, you can use
  155. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  156. Args:
  157. normalized (:class:`~tokenizers.NormalizedString`):
  158. The normalized string on which to apply this
  159. :class:`~tokenizers.normalizers.Normalizer`
  160. """
  161. pass
  162. def normalize_str(self, sequence):
  163. """
  164. Normalize the given string
  165. This method provides a way to visualize the effect of a
  166. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  167. information. If you need to get/convert offsets, you can use
  168. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  169. Args:
  170. sequence (:obj:`str`):
  171. A string to normalize
  172. Returns:
  173. :obj:`str`: A string after normalization
  174. """
  175. pass
  176. class Lowercase(Normalizer):
  177. """
  178. Lowercase Normalizer
  179. """
  180. def __init__(self):
  181. pass
  182. def __getstate__(self):
  183. """ """
  184. pass
  185. def __setstate__(self, state):
  186. """ """
  187. pass
  188. @staticmethod
  189. def custom(normalizer):
  190. """ """
  191. pass
  192. def normalize(self, normalized):
  193. """
  194. Normalize a :class:`~tokenizers.NormalizedString` in-place
  195. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  196. keep track of the alignment information. If you just want to see the result
  197. of the normalization on a raw string, you can use
  198. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  199. Args:
  200. normalized (:class:`~tokenizers.NormalizedString`):
  201. The normalized string on which to apply this
  202. :class:`~tokenizers.normalizers.Normalizer`
  203. """
  204. pass
  205. def normalize_str(self, sequence):
  206. """
  207. Normalize the given string
  208. This method provides a way to visualize the effect of a
  209. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  210. information. If you need to get/convert offsets, you can use
  211. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  212. Args:
  213. sequence (:obj:`str`):
  214. A string to normalize
  215. Returns:
  216. :obj:`str`: A string after normalization
  217. """
  218. pass
  219. class NFC(Normalizer):
  220. """
  221. NFC Unicode Normalizer
  222. """
  223. def __init__(self):
  224. pass
  225. def __getstate__(self):
  226. """ """
  227. pass
  228. def __setstate__(self, state):
  229. """ """
  230. pass
  231. @staticmethod
  232. def custom(normalizer):
  233. """ """
  234. pass
  235. def normalize(self, normalized):
  236. """
  237. Normalize a :class:`~tokenizers.NormalizedString` in-place
  238. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  239. keep track of the alignment information. If you just want to see the result
  240. of the normalization on a raw string, you can use
  241. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  242. Args:
  243. normalized (:class:`~tokenizers.NormalizedString`):
  244. The normalized string on which to apply this
  245. :class:`~tokenizers.normalizers.Normalizer`
  246. """
  247. pass
  248. def normalize_str(self, sequence):
  249. """
  250. Normalize the given string
  251. This method provides a way to visualize the effect of a
  252. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  253. information. If you need to get/convert offsets, you can use
  254. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  255. Args:
  256. sequence (:obj:`str`):
  257. A string to normalize
  258. Returns:
  259. :obj:`str`: A string after normalization
  260. """
  261. pass
  262. class NFD(Normalizer):
  263. """
  264. NFD Unicode Normalizer
  265. """
  266. def __init__(self):
  267. pass
  268. def __getstate__(self):
  269. """ """
  270. pass
  271. def __setstate__(self, state):
  272. """ """
  273. pass
  274. @staticmethod
  275. def custom(normalizer):
  276. """ """
  277. pass
  278. def normalize(self, normalized):
  279. """
  280. Normalize a :class:`~tokenizers.NormalizedString` in-place
  281. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  282. keep track of the alignment information. If you just want to see the result
  283. of the normalization on a raw string, you can use
  284. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  285. Args:
  286. normalized (:class:`~tokenizers.NormalizedString`):
  287. The normalized string on which to apply this
  288. :class:`~tokenizers.normalizers.Normalizer`
  289. """
  290. pass
  291. def normalize_str(self, sequence):
  292. """
  293. Normalize the given string
  294. This method provides a way to visualize the effect of a
  295. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  296. information. If you need to get/convert offsets, you can use
  297. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  298. Args:
  299. sequence (:obj:`str`):
  300. A string to normalize
  301. Returns:
  302. :obj:`str`: A string after normalization
  303. """
  304. pass
  305. class NFKC(Normalizer):
  306. """
  307. NFKC Unicode Normalizer
  308. """
  309. def __init__(self):
  310. pass
  311. def __getstate__(self):
  312. """ """
  313. pass
  314. def __setstate__(self, state):
  315. """ """
  316. pass
  317. @staticmethod
  318. def custom(normalizer):
  319. """ """
  320. pass
  321. def normalize(self, normalized):
  322. """
  323. Normalize a :class:`~tokenizers.NormalizedString` in-place
  324. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  325. keep track of the alignment information. If you just want to see the result
  326. of the normalization on a raw string, you can use
  327. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  328. Args:
  329. normalized (:class:`~tokenizers.NormalizedString`):
  330. The normalized string on which to apply this
  331. :class:`~tokenizers.normalizers.Normalizer`
  332. """
  333. pass
  334. def normalize_str(self, sequence):
  335. """
  336. Normalize the given string
  337. This method provides a way to visualize the effect of a
  338. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  339. information. If you need to get/convert offsets, you can use
  340. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  341. Args:
  342. sequence (:obj:`str`):
  343. A string to normalize
  344. Returns:
  345. :obj:`str`: A string after normalization
  346. """
  347. pass
  348. class NFKD(Normalizer):
  349. """
  350. NFKD Unicode Normalizer
  351. """
  352. def __init__(self):
  353. pass
  354. def __getstate__(self):
  355. """ """
  356. pass
  357. def __setstate__(self, state):
  358. """ """
  359. pass
  360. @staticmethod
  361. def custom(normalizer):
  362. """ """
  363. pass
  364. def normalize(self, normalized):
  365. """
  366. Normalize a :class:`~tokenizers.NormalizedString` in-place
  367. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  368. keep track of the alignment information. If you just want to see the result
  369. of the normalization on a raw string, you can use
  370. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  371. Args:
  372. normalized (:class:`~tokenizers.NormalizedString`):
  373. The normalized string on which to apply this
  374. :class:`~tokenizers.normalizers.Normalizer`
  375. """
  376. pass
  377. def normalize_str(self, sequence):
  378. """
  379. Normalize the given string
  380. This method provides a way to visualize the effect of a
  381. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  382. information. If you need to get/convert offsets, you can use
  383. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  384. Args:
  385. sequence (:obj:`str`):
  386. A string to normalize
  387. Returns:
  388. :obj:`str`: A string after normalization
  389. """
  390. pass
  391. class Nmt(Normalizer):
  392. """
  393. Nmt normalizer
  394. """
  395. def __init__(self):
  396. pass
  397. def __getstate__(self):
  398. """ """
  399. pass
  400. def __setstate__(self, state):
  401. """ """
  402. pass
  403. @staticmethod
  404. def custom(normalizer):
  405. """ """
  406. pass
  407. def normalize(self, normalized):
  408. """
  409. Normalize a :class:`~tokenizers.NormalizedString` in-place
  410. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  411. keep track of the alignment information. If you just want to see the result
  412. of the normalization on a raw string, you can use
  413. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  414. Args:
  415. normalized (:class:`~tokenizers.NormalizedString`):
  416. The normalized string on which to apply this
  417. :class:`~tokenizers.normalizers.Normalizer`
  418. """
  419. pass
  420. def normalize_str(self, sequence):
  421. """
  422. Normalize the given string
  423. This method provides a way to visualize the effect of a
  424. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  425. information. If you need to get/convert offsets, you can use
  426. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  427. Args:
  428. sequence (:obj:`str`):
  429. A string to normalize
  430. Returns:
  431. :obj:`str`: A string after normalization
  432. """
  433. pass
  434. class Precompiled(Normalizer):
  435. """
  436. Precompiled normalizer
  437. Don't use manually it is used for compatibility for SentencePiece.
  438. """
  439. def __init__(self, precompiled_charsmap):
  440. pass
  441. def __getstate__(self):
  442. """ """
  443. pass
  444. def __setstate__(self, state):
  445. """ """
  446. pass
  447. @staticmethod
  448. def custom(normalizer):
  449. """ """
  450. pass
  451. def normalize(self, normalized):
  452. """
  453. Normalize a :class:`~tokenizers.NormalizedString` in-place
  454. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  455. keep track of the alignment information. If you just want to see the result
  456. of the normalization on a raw string, you can use
  457. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  458. Args:
  459. normalized (:class:`~tokenizers.NormalizedString`):
  460. The normalized string on which to apply this
  461. :class:`~tokenizers.normalizers.Normalizer`
  462. """
  463. pass
  464. def normalize_str(self, sequence):
  465. """
  466. Normalize the given string
  467. This method provides a way to visualize the effect of a
  468. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  469. information. If you need to get/convert offsets, you can use
  470. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  471. Args:
  472. sequence (:obj:`str`):
  473. A string to normalize
  474. Returns:
  475. :obj:`str`: A string after normalization
  476. """
  477. pass
  478. class Prepend(Normalizer):
  479. """
  480. Prepend normalizer
  481. """
  482. def __init__(self, prepend):
  483. pass
  484. def __getstate__(self):
  485. """ """
  486. pass
  487. def __setstate__(self, state):
  488. """ """
  489. pass
  490. @staticmethod
  491. def custom(normalizer):
  492. """ """
  493. pass
  494. def normalize(self, normalized):
  495. """
  496. Normalize a :class:`~tokenizers.NormalizedString` in-place
  497. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  498. keep track of the alignment information. If you just want to see the result
  499. of the normalization on a raw string, you can use
  500. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  501. Args:
  502. normalized (:class:`~tokenizers.NormalizedString`):
  503. The normalized string on which to apply this
  504. :class:`~tokenizers.normalizers.Normalizer`
  505. """
  506. pass
  507. def normalize_str(self, sequence):
  508. """
  509. Normalize the given string
  510. This method provides a way to visualize the effect of a
  511. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  512. information. If you need to get/convert offsets, you can use
  513. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  514. Args:
  515. sequence (:obj:`str`):
  516. A string to normalize
  517. Returns:
  518. :obj:`str`: A string after normalization
  519. """
  520. pass
  521. @property
  522. def prepend(self):
  523. """ """
  524. pass
  525. @prepend.setter
  526. def prepend(self, value):
  527. """ """
  528. pass
  529. class Replace(Normalizer):
  530. """
  531. Replace normalizer
  532. """
  533. def __init__(self, pattern, content):
  534. pass
  535. def __getstate__(self):
  536. """ """
  537. pass
  538. def __setstate__(self, state):
  539. """ """
  540. pass
  541. @property
  542. def content(self):
  543. """ """
  544. pass
  545. @content.setter
  546. def content(self, value):
  547. """ """
  548. pass
  549. @staticmethod
  550. def custom(normalizer):
  551. """ """
  552. pass
  553. def normalize(self, normalized):
  554. """
  555. Normalize a :class:`~tokenizers.NormalizedString` in-place
  556. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  557. keep track of the alignment information. If you just want to see the result
  558. of the normalization on a raw string, you can use
  559. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  560. Args:
  561. normalized (:class:`~tokenizers.NormalizedString`):
  562. The normalized string on which to apply this
  563. :class:`~tokenizers.normalizers.Normalizer`
  564. """
  565. pass
  566. def normalize_str(self, sequence):
  567. """
  568. Normalize the given string
  569. This method provides a way to visualize the effect of a
  570. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  571. information. If you need to get/convert offsets, you can use
  572. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  573. Args:
  574. sequence (:obj:`str`):
  575. A string to normalize
  576. Returns:
  577. :obj:`str`: A string after normalization
  578. """
  579. pass
  580. @property
  581. def pattern(self):
  582. """ """
  583. pass
  584. @pattern.setter
  585. def pattern(self, value):
  586. """ """
  587. pass
  588. class Sequence(Normalizer):
  589. """
  590. Allows concatenating multiple other Normalizer as a Sequence.
  591. All the normalizers run in sequence in the given order
  592. Args:
  593. normalizers (:obj:`List[Normalizer]`):
  594. A list of Normalizer to be run as a sequence
  595. """
  596. def __init__(self, normalizers):
  597. pass
  598. def __getitem__(self, key):
  599. """
  600. Return self[key].
  601. """
  602. pass
  603. def __getnewargs__(self):
  604. """ """
  605. pass
  606. def __getstate__(self):
  607. """ """
  608. pass
  609. def __setitem__(self, key, value):
  610. """
  611. Set self[key] to value.
  612. """
  613. pass
  614. def __setstate__(self, state):
  615. """ """
  616. pass
  617. @staticmethod
  618. def custom(normalizer):
  619. """ """
  620. pass
  621. def normalize(self, normalized):
  622. """
  623. Normalize a :class:`~tokenizers.NormalizedString` in-place
  624. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  625. keep track of the alignment information. If you just want to see the result
  626. of the normalization on a raw string, you can use
  627. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  628. Args:
  629. normalized (:class:`~tokenizers.NormalizedString`):
  630. The normalized string on which to apply this
  631. :class:`~tokenizers.normalizers.Normalizer`
  632. """
  633. pass
  634. def normalize_str(self, sequence):
  635. """
  636. Normalize the given string
  637. This method provides a way to visualize the effect of a
  638. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  639. information. If you need to get/convert offsets, you can use
  640. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  641. Args:
  642. sequence (:obj:`str`):
  643. A string to normalize
  644. Returns:
  645. :obj:`str`: A string after normalization
  646. """
  647. pass
  648. class Strip(Normalizer):
  649. """
  650. Strip normalizer
  651. """
  652. def __init__(self, left=True, right=True):
  653. pass
  654. def __getstate__(self):
  655. """ """
  656. pass
  657. def __setstate__(self, state):
  658. """ """
  659. pass
  660. @staticmethod
  661. def custom(normalizer):
  662. """ """
  663. pass
  664. @property
  665. def left(self):
  666. """ """
  667. pass
  668. @left.setter
  669. def left(self, value):
  670. """ """
  671. pass
  672. def normalize(self, normalized):
  673. """
  674. Normalize a :class:`~tokenizers.NormalizedString` in-place
  675. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  676. keep track of the alignment information. If you just want to see the result
  677. of the normalization on a raw string, you can use
  678. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  679. Args:
  680. normalized (:class:`~tokenizers.NormalizedString`):
  681. The normalized string on which to apply this
  682. :class:`~tokenizers.normalizers.Normalizer`
  683. """
  684. pass
  685. def normalize_str(self, sequence):
  686. """
  687. Normalize the given string
  688. This method provides a way to visualize the effect of a
  689. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  690. information. If you need to get/convert offsets, you can use
  691. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  692. Args:
  693. sequence (:obj:`str`):
  694. A string to normalize
  695. Returns:
  696. :obj:`str`: A string after normalization
  697. """
  698. pass
  699. @property
  700. def right(self):
  701. """ """
  702. pass
  703. @right.setter
  704. def right(self, value):
  705. """ """
  706. pass
  707. class StripAccents(Normalizer):
  708. """
  709. StripAccents normalizer
  710. """
  711. def __init__(self):
  712. pass
  713. def __getstate__(self):
  714. """ """
  715. pass
  716. def __setstate__(self, state):
  717. """ """
  718. pass
  719. @staticmethod
  720. def custom(normalizer):
  721. """ """
  722. pass
  723. def normalize(self, normalized):
  724. """
  725. Normalize a :class:`~tokenizers.NormalizedString` in-place
  726. This method allows to modify a :class:`~tokenizers.NormalizedString` to
  727. keep track of the alignment information. If you just want to see the result
  728. of the normalization on a raw string, you can use
  729. :meth:`~tokenizers.normalizers.Normalizer.normalize_str`
  730. Args:
  731. normalized (:class:`~tokenizers.NormalizedString`):
  732. The normalized string on which to apply this
  733. :class:`~tokenizers.normalizers.Normalizer`
  734. """
  735. pass
  736. def normalize_str(self, sequence):
  737. """
  738. Normalize the given string
  739. This method provides a way to visualize the effect of a
  740. :class:`~tokenizers.normalizers.Normalizer` but it does not keep track of the alignment
  741. information. If you need to get/convert offsets, you can use
  742. :meth:`~tokenizers.normalizers.Normalizer.normalize`
  743. Args:
  744. sequence (:obj:`str`):
  745. A string to normalize
  746. Returns:
  747. :obj:`str`: A string after normalization
  748. """
  749. pass
  750. from typing import Dict
  751. NORMALIZERS: Dict[str, Normalizer]
  752. def unicode_normalizer_from_str(normalizer: str) -> Normalizer: ...