File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,20 @@ public static long mixedNumberWordToLong(String numberWord) throws NumberFormatE
93
93
}
94
94
}
95
95
96
- public static String cleanWhiteSpaces (String s ) {
96
+ public static String removeWhiteSpaces (String s ) {
97
97
return s .replaceAll ("(\\ s| | )" , "" );
98
98
}
99
99
100
- //does the same as the function above, but for the 80 languages supported by YouTube.
100
+ /**
101
+ * Does the same as {@link #mixedNumberWordToLong(String)}, but for the 80 languages supported by YouTube.
102
+ *
103
+ * @param numberWord
104
+ * @param loc
105
+ * @return
106
+ * @throws ParsingException
107
+ */
101
108
public static long mixedNumberWordToLong (String numberWord , Localization loc ) throws ParsingException {
102
- numberWord = cleanWhiteSpaces (numberWord );
109
+ numberWord = removeWhiteSpaces (numberWord );
103
110
String langCode = loc .getLanguageCode ();
104
111
String abbreviation = removeNumber (numberWord );
105
112
Original file line number Diff line number Diff line change 22
22
import static org .junit .Assert .assertEquals ;
23
23
import static org .schabi .newpipe .extractor .ServiceList .YouTube ;
24
24
import static org .schabi .newpipe .extractor .localization .AbbreviationHelper .abbreviationSubscribersCount ;
25
- import static org .schabi .newpipe .extractor .utils .Utils .cleanWhiteSpaces ;
26
25
import static org .schabi .newpipe .extractor .utils .Utils .removeNumber ;
26
+ import static org .schabi .newpipe .extractor .utils .Utils .removeWhiteSpaces ;
27
27
28
28
/**
29
29
* A class that tests abbreviations and subscriber counts for all the languages YouTube supports.
30
30
*/
31
31
@ Ignore ("Should be ran manually from time to time, as it's too time consuming." )
32
- public class YoutubeSubcriberTest {
32
+ public class YoutubeSubscriberTest {
33
33
34
34
private static final String url = "https://www.youtube.com/feed/guide_builder" ;
35
35
private static final int PAUSE_DURATION_EXTRACTORS = 250 ;
36
36
private static final int PAUSE_DURATION_ABBREVIATIONS = 125 ;
37
37
38
38
public static String getAbbreviation (String count ) {
39
- return removeNumber (cleanWhiteSpaces (count ));
39
+ return removeNumber (removeWhiteSpaces (count ));
40
40
}
41
41
42
42
public static void assertEqualsWithEnglish (String channelUrl ) throws ExtractionException , IOException , InterruptedException {
You can’t perform that action at this time.
0 commit comments