fix regex and assign random user ids

This commit is contained in:
Xavier Léauté 2013-09-05 13:42:46 -07:00
parent 5a64e2a64a
commit cd14e7fbca
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -50,8 +50,10 @@ class WikipediaIrcDecoder implements IrcDecoder
final DatabaseReader geoLookup;
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 shortnamePattern = Pattern.compile("#(\\w\\w)\\..*");