Skip to content

Commit 80dc928

Browse files
committed
fixed namings
1 parent 7e882db commit 80dc928

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

scripts/src/main/scala/org/dbpedia/extraction/scripts/LanguageSpecificLinksGenerator.scala

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import scala.io.Source
66
import scala.io._
77
import sys.process._
88
import org.dbpedia.util.text.uri._
9-
import org.dbpedia.extraction.util._
9+
import org.dbpedia.extraction.util.RichFile
10+
import org.dbpedia.extraction.util.FileLike
1011
import java.util.zip.{GZIPInputStream, GZIPOutputStream}
1112
import org.apache.commons.compress.compressors.bzip2.{BZip2CompressorInputStream, BZip2CompressorOutputStream}
1213

@@ -111,6 +112,7 @@ object LanguageSpecificLinksGenerator {
111112

112113
def main(args: Array[String]) {
113114
//todo : add some requires here to check for arguments
115+
val startTime = System.nanoTime
114116
//arg1 = 0
115117
val option = args(0)
116118

@@ -122,8 +124,8 @@ object LanguageSpecificLinksGenerator {
122124
*/
123125
if(option == "0")
124126
{
125-
val baseDir = new File(args(1))
126-
val file = Source.fromFile(baseDir)
127+
val inFile = new File(args(1))
128+
val file = Source.fromFile(inFile)
127129

128130
//languagelinks triples needed are those contain schema:about predicates and wikipediapages subjects which indicated wikipedia page
129131
val regx = """.*\.wikipedia.org\/wiki.*<http:\/\/schema\.org\/about>""".r
@@ -158,11 +160,10 @@ object LanguageSpecificLinksGenerator {
158160
*/
159161
if(option == "1")
160162
{
161-
val startTime = System.nanoTime
162163

163164
//opening master file for language links
164-
val baseDir = new File(args(1))
165-
val file = Source.fromFile(baseDir)
165+
val inFile = new File(args(1))
166+
val file = Source.fromFile(inFile)
166167

167168
//creating folder for output files
168169
new File("./llinkfiles").mkdir()
@@ -193,7 +194,7 @@ object LanguageSpecificLinksGenerator {
193194
val langRegx(lang) = obj
194195

195196
//initializing file name
196-
val fileName = "./llinkfiles/interlanguage_links_same_as_"+lang+".ttl"
197+
val outFileName = "./llinkfiles/interlanguage_links_same_as_"+lang+".ttl"
197198

198199
//removing itself
199200
val innerTripleObjects = triplesObjects.diff(List(obj))
@@ -202,7 +203,7 @@ object LanguageSpecificLinksGenerator {
202203
//logtofile funciton includes creating files if not exist
203204
for(obj2 <- innerTripleObjects)
204205
{
205-
logToFile(fileName,obj +" <http://www.w3.org/2002/07/owl#sameAs> " +obj2+" .")
206+
logToFile(outFileName,obj +" <http://www.w3.org/2002/07/owl#sameAs> " +obj2+" .")
206207
}
207208

208209
}
@@ -215,10 +216,6 @@ object LanguageSpecificLinksGenerator {
215216
}
216217

217218
closeWriters()
218-
219-
print("time taken: " + (System.nanoTime - startTime)/1000000000 +" secs+\n" )
220-
221-
222219
}
223220

224221

@@ -239,6 +236,8 @@ object LanguageSpecificLinksGenerator {
239236
}
240237

241238

239+
print("time taken: " + (System.nanoTime - startTime)/1000000000 +" secs\n" )
240+
242241
}
243242

244243

0 commit comments

Comments
 (0)