Skip to content

Commit

Permalink
revert config file changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tahoe01 authored and baiqiushi committed Dec 29, 2020
1 parent dba9565 commit 9caf3d0
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object TwitterJSONTagToADM {
var isDebug = false
val bufferSize = 100
var file = "ADM" // By default, generate ADM file.
var counter = 1

val usage =
"""
|Usage: USHierarchyBuilder -state /path/to/state.json -county /path/to/county.json -city /path/to/city.json
Expand All @@ -42,17 +42,15 @@ object TwitterJSONTagToADM {
}
}

def tagOneTweet(ln: String, usGeoGnosis: USGeoGnosis) = synchronized {
def tagOneTweet(ln: String, usGeoGnosis: USGeoGnosis) = {
try {
if (file.equals("ADM")) {
val adm = Tweet.toADM(TwitterObjectFactory.createStatus(ln), usGeoGnosis, true)
if (adm.length > 0) println(adm)
} else {
val json = Tweet.toJSON(TwitterObjectFactory.createStatus(ln), usGeoGnosis, true)
if (json.length > 0) {
val indexStr = s"""{ "index": {"_id": "$counter" } }"""
counter += 1
println(indexStr + "\n" + json)
println("""{ "index": {} }""" + "\n" + json)
}
}
} catch {
Expand Down

0 comments on commit 9caf3d0

Please sign in to comment.