@Test public void testSimpleTitle() throws IOException { input = tupleFactory.newTuple(1); input.set(0, "http: output = tupleFactory.newTuple(1); output = canonicalizeArticleTitle.exec(input); assertEquals("Conquistador", output.get(0)); }
@Override public Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } output = tupleFactory.newTuple(3); ProjectInfo projectInfo; try { url = new URL((String) input.get(0)); pageviewCanonical = new PageviewCanonical(url); pageviewCanonical.canonicalize(mode); projectInfo = new ProjectInfo(url.getHost()); } catch (MalformedURLException e) { return null; } output.set(0, pageviewCanonical.getArticleTitle()); output.set(1, projectInfo.getLanguage()); output.set(2, projectInfo.getProjectDomain()); return output; }
CanonicalizeArticleTitle extends EvalFunc<Tuple> { @Override public Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } output = tupleFactory.newTuple(3); ProjectInfo projectInfo; try { url = new URL((String) input.get(0)); pageviewCanonical = new PageviewCanonical(url); pageviewCanonical.canonicalize(mode); projectInfo = new ProjectInfo(url.getHost()); } catch (MalformedURLException e) { return null; } output.set(0, pageviewCanonical.getArticleTitle()); output.set(1, projectInfo.getLanguage()); output.set(2, projectInfo.getProjectDomain()); return output; } }
CanonicalizeArticleTitle extends EvalFunc<Tuple> { @Override public Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } output = tupleFactory.newTuple(3); ProjectInfo projectInfo; try { url = new URL((String) input.get(0)); pageviewCanonical = new PageviewCanonical(url); pageviewCanonical.canonicalize(mode); projectInfo = new ProjectInfo(url.getHost()); } catch (MalformedURLException e) { return null; } output.set(0, pageviewCanonical.getArticleTitle()); output.set(1, projectInfo.getLanguage()); output.set(2, projectInfo.getProjectDomain()); return output; } CanonicalizeArticleTitle();  CanonicalizeArticleTitle(String mode); }
CanonicalizeArticleTitle extends EvalFunc<Tuple> { @Override public Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } output = tupleFactory.newTuple(3); ProjectInfo projectInfo; try { url = new URL((String) input.get(0)); pageviewCanonical = new PageviewCanonical(url); pageviewCanonical.canonicalize(mode); projectInfo = new ProjectInfo(url.getHost()); } catch (MalformedURLException e) { return null; } output.set(0, pageviewCanonical.getArticleTitle()); output.set(1, projectInfo.getLanguage()); output.set(2, projectInfo.getProjectDomain()); return output; } CanonicalizeArticleTitle();  CanonicalizeArticleTitle(String mode); @Override Tuple exec(final Tuple input); }
CanonicalizeArticleTitle extends EvalFunc<Tuple> { @Override public Tuple exec(final Tuple input) throws IOException { if (input == null || input.get(0) == null) { return null; } output = tupleFactory.newTuple(3); ProjectInfo projectInfo; try { url = new URL((String) input.get(0)); pageviewCanonical = new PageviewCanonical(url); pageviewCanonical.canonicalize(mode); projectInfo = new ProjectInfo(url.getHost()); } catch (MalformedURLException e) { return null; } output.set(0, pageviewCanonical.getArticleTitle()); output.set(1, projectInfo.getLanguage()); output.set(2, projectInfo.getProjectDomain()); return output; } CanonicalizeArticleTitle();  CanonicalizeArticleTitle(String mode); @Override Tuple exec(final Tuple input);  }