Reapply "fix regex and assign random user ids" from Xavier

This commit is contained in:
cheddar 2013-09-18 17:15:15 -05:00
parent d61fe9585a
commit 6150365c12
2 changed files with 5 additions and 4 deletions

View File

@ -39,6 +39,7 @@ import org.joda.time.DateTime;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
/** /**
@ -147,9 +148,7 @@ public class IrcFirehoseFactory implements FirehoseFactory
@Override @Override
public List<String> getAlternativeNicknames() public List<String> getAlternativeNicknames()
{ {
return Lists.newArrayList(nick + "_", return Lists.newArrayList(nick + UUID.randomUUID(), nick + UUID.randomUUID(), nick + UUID.randomUUID());
nick + "__",
nick + "___");
} }
@Override @Override

View File

@ -50,8 +50,10 @@ class WikipediaIrcDecoder implements IrcDecoder
final DatabaseReader geoLookup; final DatabaseReader geoLookup;
static final Pattern pattern = Pattern.compile( static final Pattern pattern = Pattern.compile(
"\\x0314\\[\\[\\x0307(.+?)\\x0314\\]\\]\\x034 (.*?)\\x0310.*\\x0302(http.+?)\\x03.+\\x0303(.+?)\\x03.+\\x03 (\\(([+-]\\d+)\\).*|.+) \\x0310(.+)\\x03" ".*\\x0314\\[\\[\\x0307(.+?)\\x0314\\]\\]\\x034 (.*?)\\x0310.*\\x0302(http.+?)" +
"\\x03.+\\x0303(.+?)\\x03.+\\x03 (\\(([+-]\\d+)\\).*|.+) \\x0310(.+)\\x03.*"
); );
static final Pattern ipPattern = Pattern.compile("\\d+.\\d+.\\d+.\\d+"); static final Pattern ipPattern = Pattern.compile("\\d+.\\d+.\\d+.\\d+");
static final Pattern shortnamePattern = Pattern.compile("#(\\w\\w)\\..*"); static final Pattern shortnamePattern = Pattern.compile("#(\\w\\w)\\..*");