Skip to content

Commit

Permalink
rename project twofish -> twofishes
Browse files Browse the repository at this point in the history
  • Loading branch information
David Blackman committed Apr 1, 2012
1 parent 32df2da commit 2a364e8
Show file tree
Hide file tree
Showing 31 changed files with 49 additions and 53 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/GeocodeStorage.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish
package com.foursquare.twofishes

import com.twitter.util.{Future, FuturePool}
import org.bson.types.ObjectId
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/HFileStorageService.scala
@@ -1,4 +1,4 @@
package com.foursquare.twofish
package com.foursquare.twofishes

import java.io._
import java.net.URI
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/Helpers.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish
package com.foursquare.twofishes

import java.text.Normalizer
import java.util.regex.Pattern
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/LogHelper.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish
package com.foursquare.twofishes

import com.twitter.logging.Logger
import com.twitter.logging.config._
Expand All @@ -17,8 +17,8 @@ object LogHelper {
}

object NullLogger {
def ifTrace(msg: => String) {
println(msg)
def ifTrace(msg: => String) {
// println(msg)
}
def error(s: String) {}
def info(s: String) {}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/scala/YahooWoeTypes.scala
@@ -1,7 +1,7 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish
package com.foursquare.twofishes

import com.foursquare.twofish.YahooWoeType._
import com.foursquare.twofishes.YahooWoeType._

object YahooWoeTypes {
val order = List(POSTAL_CODE, AIRPORT, TOWN, SUBURB, ADMIN3, ADMIN2, ADMIN1, COUNTRY)
Expand Down
2 changes: 1 addition & 1 deletion indexer/src/main/scala/GeocodeRecordWriter.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish
package com.foursquare.twofishes

import com.novus.salat._
import com.novus.salat.global._
Expand Down
2 changes: 1 addition & 1 deletion indexer/src/main/scala/OutputHFile.scala
@@ -1,4 +1,4 @@
package com.foursquare.twofish
package com.foursquare.twofishes

import com.mongodb.casbah.Imports._
import com.mongodb.casbah.MongoConnection
Expand Down
@@ -1,7 +1,7 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish.importers.geonames
package com.foursquare.twofishes.importers.geonames

import com.foursquare.twofish._
import com.foursquare.twofishes._
import java.io.File

// I could not for the life of me get the java geojson libraries to work
Expand Down
@@ -1,8 +1,8 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish.importers.geonames
package com.foursquare.twofishes.importers.geonames

import com.foursquare.twofish.Helpers._
import com.foursquare.twofish.{Helpers, LogHelper, YahooWoeType}
import com.foursquare.twofishes.Helpers._
import com.foursquare.twofishes.{Helpers, LogHelper, YahooWoeType}
import org.bson.types.ObjectId

object GeonamesFeatureColumns extends Enumeration {
Expand Down
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish.importers.geonames
package com.foursquare.twofishes.importers.geonames

class GeonamesImporterConfig(args: Array[String]) {
// Buildings are places like the eiffel tower, but also schools and federal offices.
Expand All @@ -26,7 +26,7 @@ class GeonamesImporterConfig(args: Array[String]) {
private val config = this

val parser =
new scopt.OptionParser("twofish", "0.12") {
new scopt.OptionParser("twofishes", "0.12") {
booleanOpt("parse_world", "parse the whole world, or one country",
{ v: Boolean => config.parseWorld = v } )
opt("parse_country", "country to parse, two letter iso code",
Expand Down
@@ -1,9 +1,9 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish.importers.geonames
package com.foursquare.twofishes.importers.geonames

import com.foursquare.twofish._
import com.foursquare.twofish.Helpers._
import com.foursquare.twofish.Implicits._
import com.foursquare.twofishes._
import com.foursquare.twofishes.Helpers._
import com.foursquare.twofishes.Implicits._
import java.io.File

object GeonamesParser {
Expand Down
@@ -1,7 +1,7 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved.
package com.foursquare.twofish.importers.geonames
package com.foursquare.twofishes.importers.geonames

import com.foursquare.twofish.LogHelper
import com.foursquare.twofishes.LogHelper
import java.io.File

class TsvHelperFileParser(filename: String) extends LogHelper {
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;


import java.util.Map;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;

import java.util.List;
import java.util.ArrayList;
Expand Down
Expand Up @@ -3,7 +3,7 @@
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
*/
package com.foursquare.twofish;
package com.foursquare.twofishes;


import java.util.Map;
Expand Down
2 changes: 1 addition & 1 deletion interface/src/main/thrift/geocoder.thrift
@@ -1,4 +1,4 @@
namespace java com.foursquare.twofish
namespace java com.foursquare.twofishes

// comments from http://developer.yahoo.com/geo/geoplanet/guide/concepts.html
enum YahooWoeType {
Expand Down
12 changes: 6 additions & 6 deletions project/GeocoderBuild.scala
Expand Up @@ -5,8 +5,8 @@ import AssemblyKeys._

object GeocoderBuild extends Build {
lazy val buildSettings = Seq(
organization := "com.foursquare.twofish",
name := "twofish",
organization := "com.foursquare.twofishes",
name := "twofishes",
version := "0.12",
scalaVersion := "2.9.1"
)
Expand All @@ -28,7 +28,7 @@ object GeocoderBuild extends Build {
Keys.publishArtifact in (Compile, Keys.packageDoc) := false,

pomExtra := (
<url>http://github.com/foursquare/twofish</url>
<url>http://github.com/foursquare/twofishes</url>
<licenses>
<license>
<name>Apache</name>
Expand All @@ -37,8 +37,8 @@ object GeocoderBuild extends Build {
</license>
</licenses>
<scm>
<url>git@github.com:foursquare/twofish.git</url>
<connection>scm:git:git@github.com:foursquare/twofish.git</connection>
<url>git@github.com:foursquare/twofishes.git</url>
<connection>scm:git:git@github.com:foursquare/twofishes.git</connection>
</scm>
<developers>
<developer>
Expand Down Expand Up @@ -105,7 +105,7 @@ object GeocoderBuild extends Build {

lazy val server = Project(id = "server",
settings = defaultSettings ++ assemblySettings ++ Seq(
mainClass in assembly := Some("com.foursquare.twofish.GeocodeFinagleServer"),
mainClass in assembly := Some("com.foursquare.twofishes.GeocodeFinagleServer"),
publishArtifact := true,
libraryDependencies ++= Seq(
"com.twitter" % "finagle-http_2.9.1" % "1.9.12",
Expand Down
8 changes: 2 additions & 6 deletions server/src/main/scala/GeocodeImpl.scala
@@ -1,7 +1,7 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved
package com.foursquare.twofish
package com.foursquare.twofishes

import com.foursquare.twofish.Implicits._
import com.foursquare.twofishes.Implicits._
import com.twitter.util.{Future, FuturePool}
import java.util.concurrent.ConcurrentHashMap
import org.bson.types.ObjectId
Expand Down Expand Up @@ -266,14 +266,10 @@ class GeocoderImpl(store: GeocodeStorageFutureReadService) extends LogHelper {
val connectorEnd = connectorStart
val hadConnector = connectorStart != -1

println(hadConnector)

val tokens = if (hadConnector) {
originalTokens.drop(connectorEnd + 1)
} else { originalTokens }

println(tokens)

val cache = generateParses(tokens)
val futureCache: Iterable[Future[(Int, ParseSeq)]] = cache.map({case (k, v) => {
Future.value(k).join(v)
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/scala/GeocodeServer.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved
package com.foursquare.twofish
package com.foursquare.twofishes

import collection.JavaConverters._
import com.twitter.finagle.builder.{ServerBuilder, Server}
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/scala/GeocodeServerConfig.scala
@@ -1,5 +1,5 @@
// Copyright 2012 Foursquare Labs Inc. All Rights Reserved
package com.foursquare.twofish
package com.foursquare.twofishes

class GeocodeServerConfig(args: Array[String]) {
var runHttpServer: Boolean = true
Expand All @@ -9,7 +9,7 @@ class GeocodeServerConfig(args: Array[String]) {
private val config = this

val parser =
new scopt.OptionParser("twofish", "0.12") {
new scopt.OptionParser("twofishes", "0.12") {
intOpt("p", "port", "port to run thrift server on",
{ v: Int => config.thriftServerPort = v } )
booleanOpt("h", "run_http_server", "whether or not to run http/json server on port+1",
Expand Down

0 comments on commit 2a364e8

Please sign in to comment.