fts5porter2.test 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # 2014 Dec 20
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #***********************************************************************
  11. #
  12. # Tests focusing on the fts5 porter stemmer implementation.
  13. #
  14. # These are extra tests added to those in fts5porter.test in order to
  15. # improve test coverage of the porter stemmer implementation.
  16. #
  17. source [file join [file dirname [info script]] fts5_common.tcl]
  18. set testprefix fts5porter2
  19. # If SQLITE_ENABLE_FTS5 is not defined, omit this file.
  20. ifcapable !fts5 {
  21. finish_test
  22. return
  23. }
  24. set test_vocab {
  25. tion tion
  26. ation ation
  27. vation vation
  28. avation avat
  29. vion vion
  30. ion ion
  31. relational relat
  32. relation relat
  33. relate relat
  34. zzz zzz
  35. ii ii
  36. iiing ii
  37. xtional xtional
  38. xenci xenci
  39. xlogi xlogi
  40. realization realiz
  41. realize realiz
  42. xization xizat
  43. capitalism capit
  44. talism talism
  45. xiveness xive
  46. xfulness xful
  47. xousness xous
  48. xical xical
  49. xicate xicat
  50. xicity xiciti
  51. ies ie
  52. eed e
  53. eing e
  54. s s
  55. }
  56. set i 0
  57. foreach {in out} $test_vocab {
  58. do_test "1.$i.($in -> $out)" {
  59. lindex [sqlite3_fts5_tokenize db porter $in] 0
  60. } $out
  61. incr i
  62. }
  63. finish_test