1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
use KeywordProcessor as KeywordProcessorInsensitive;
use KeywordProcessor;
// #[test]
// fn test_from_strings() {
// let empty_slice: Vec<&str> = vec![];
// assert_eq!(KeywordProcessor::from(empty_slice), KeywordProcessor::new());
//
// let arrays = [
// ["hello"].as_slice(),
// ["py", "Python", "I love python!"].as_slice(),
// ];
//
// for slice in arrays {
// let kp_from_arr = KeywordProcessor::from(slice);
//
// let mut kp = KeywordProcessor::new(false);
// for word in slice {
// kp.add_keyword(word, word);
// }
// assert_eq!(kp, kp_from_arr);
// }
// }
//
// #[test]
// fn test_from_tuples() {
// let empty_slice: &[&str] = [].as_slice();
// assert_eq!(
// KeywordProcessor::from(empty_slice),
// KeywordProcessor::new(false)
// );
//
// let arrays = [
// [("hello", "Hello!")].as_slice(),
// [
// ("py", "Python"),
// ("python", "Python"),
// ("py3", "Python 3.0"),
// ]
// .as_slice(),
// ];
//
// for slice in arrays {
// let kp_from_arr = KeywordProcessor::from(slice);
//
// let mut kp = KeywordProcessor::new(false);
// for (word, clean_word) in slice {
// kp.add_keyword(word, clean_word);
// }
// assert_eq!(kp, kp_from_arr);
// }
// }
// TODO: use test-cases from JSON in Python library