File tree Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Expand file tree Collapse file tree 4 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ Change the file contents of the appropriate file.
34
34
35
35
A simple ` git rm ` on the approriate file will do the trick.
36
36
37
- #### Refer the blacklist
38
- Please do not suggest to add domains from the blacklist . They're banned for the reason. The list currently looks like follows
37
+ #### Refer the stoplist
38
+ Please do not suggest to add domains from the stoplist . They're banned for the reason. The list currently looks like follows
39
39
* si.edu - anyone could register a domain there
40
40
* america.edu - anyone could register a domain there
41
41
* californiacolleges.edu - anyone could register e-mail account there
File renamed without changes.
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import java.io.File
7
7
*/
8
8
9
9
object CompilationState {
10
- val blacklist = File (" lib/domains/blacklist .txt" ).readLines().toHashSet()
10
+ val stoplist = File (" lib/domains/stoplist .txt" ).readLines().toHashSet()
11
11
val domains = File (" lib/domains/tlds.txt" ).readLines().toHashSet()
12
12
}
13
13
@@ -16,13 +16,13 @@ fun main(args: Array<String>) {
16
16
root.walkTopDown().forEach {
17
17
if (it.isFile) {
18
18
val parts = it.toRelativeString(root).replace(' \\ ' , ' /' ).removeSuffix(" .txt" ).split(' /' ).toList()
19
- if (! checkSet(CompilationState .blacklist , parts) && ! checkSet(CompilationState .domains, parts)) {
19
+ if (! checkSet(CompilationState .stoplist , parts) && ! checkSet(CompilationState .domains, parts)) {
20
20
CompilationState .domains.add(parts.reversed().joinToString(" ." ))
21
21
}
22
22
}
23
23
}
24
24
25
- val blacklist = CompilationState .blacklist .map { " -$it " }.sorted().joinToString(" \n " )
25
+ val stoplist = CompilationState .stoplist .map { " -$it " }.sorted().joinToString(" \n " )
26
26
File (" out/artifacts" ).mkdirs()
27
- File (" out/artifacts/swot.txt" ).writeText(blacklist + " \n " + CompilationState .domains.sorted().joinToString(" \n " ))
27
+ File (" out/artifacts/swot.txt" ).writeText(stoplist + " \n " + CompilationState .domains.sorted().joinToString(" \n " ))
28
28
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ package swot
2
2
3
3
fun isAcademic (email : String ): Boolean {
4
4
val parts = domainParts(email)
5
- return ! isBlacklisted (parts) && (isUnderTLD(parts) || findSchoolNames(parts).isNotEmpty())
5
+ return ! isStoplisted (parts) && (isUnderTLD(parts) || findSchoolNames(parts).isNotEmpty())
6
6
}
7
7
8
8
fun findSchoolNames (emailOrDomain : String ): List <String > {
@@ -13,13 +13,13 @@ fun isUnderTLD(parts: List<String>): Boolean {
13
13
return checkSet(Resources .tlds, parts)
14
14
}
15
15
16
- fun isBlacklisted (parts : List <String >): Boolean {
17
- return checkSet(Resources .blackList , parts)
16
+ fun isStoplisted (parts : List <String >): Boolean {
17
+ return checkSet(Resources .stoplist , parts)
18
18
}
19
19
20
20
private object Resources {
21
21
val tlds = readList(" /tlds.txt" ) ? : error(" Cannot find /tlds.txt" )
22
- val blackList = readList(" /blacklist .txt" ) ? : error(" Cannot find /blacklist .txt" )
22
+ val stoplist = readList(" /stoplist .txt" ) ? : error(" Cannot find /stoplist .txt" )
23
23
24
24
fun readList (resource : String ) : Set <String >? {
25
25
return javaClass.getResourceAsStream(resource)?.reader()?.buffered()?.lineSequence()?.toHashSet()
You can’t perform that action at this time.
0 commit comments