@Test public void numIfBookmarkWithHash() { String url = "https: String num = Arxiv.url2num(url); assertTrue(num.equals("1912.08904")); }
static public String url2num(String url) { if (!url.startsWith(ARXIV_NS)) { if (!url.startsWith(ARXIV_NS_OLD)) { return null; } else { url = "https:" + url.substring(5); } } String x = null; int k = url.indexOf("#"); if (k > 0) url = url.substring(0,k); k = url.indexOf("?"); if (k > 0) url = url.substring(0,k); if (url.startsWith(ABS)) { x = url.substring(ABS_LEN); } else if (url.startsWith(PDF)) { x = url.substring(PDF_LEN); x = x.substring(0, x.length()-4); } else { return null; } k = x.indexOf("v"); if (k>0) { x = x.substring(0,k); } return x; }
Arxiv { static public String url2num(String url) { if (!url.startsWith(ARXIV_NS)) { if (!url.startsWith(ARXIV_NS_OLD)) { return null; } else { url = "https:" + url.substring(5); } } String x = null; int k = url.indexOf("#"); if (k > 0) url = url.substring(0,k); k = url.indexOf("?"); if (k > 0) url = url.substring(0,k); if (url.startsWith(ABS)) { x = url.substring(ABS_LEN); } else if (url.startsWith(PDF)) { x = url.substring(PDF_LEN); x = x.substring(0, x.length()-4); } else { return null; } k = x.indexOf("v"); if (k>0) { x = x.substring(0,k); } return x; } }
Arxiv { static public String url2num(String url) { if (!url.startsWith(ARXIV_NS)) { if (!url.startsWith(ARXIV_NS_OLD)) { return null; } else { url = "https:" + url.substring(5); } } String x = null; int k = url.indexOf("#"); if (k > 0) url = url.substring(0,k); k = url.indexOf("?"); if (k > 0) url = url.substring(0,k); if (url.startsWith(ABS)) { x = url.substring(ABS_LEN); } else if (url.startsWith(PDF)) { x = url.substring(PDF_LEN); x = x.substring(0, x.length()-4); } else { return null; } k = x.indexOf("v"); if (k>0) { x = x.substring(0,k); } return x; }  }
Arxiv { static public String url2num(String url) { if (!url.startsWith(ARXIV_NS)) { if (!url.startsWith(ARXIV_NS_OLD)) { return null; } else { url = "https:" + url.substring(5); } } String x = null; int k = url.indexOf("#"); if (k > 0) url = url.substring(0,k); k = url.indexOf("?"); if (k > 0) url = url.substring(0,k); if (url.startsWith(ABS)) { x = url.substring(ABS_LEN); } else if (url.startsWith(PDF)) { x = url.substring(PDF_LEN); x = x.substring(0, x.length()-4); } else { return null; } k = x.indexOf("v"); if (k>0) { x = x.substring(0,k); } return x; }  static String url2num(String url); static String url2pdfUrl(String url); static String sldoc2arxivNum(SLDocument doc, SLModel mod); }
Arxiv { static public String url2num(String url) { if (!url.startsWith(ARXIV_NS)) { if (!url.startsWith(ARXIV_NS_OLD)) { return null; } else { url = "https:" + url.substring(5); } } String x = null; int k = url.indexOf("#"); if (k > 0) url = url.substring(0,k); k = url.indexOf("?"); if (k > 0) url = url.substring(0,k); if (url.startsWith(ABS)) { x = url.substring(ABS_LEN); } else if (url.startsWith(PDF)) { x = url.substring(PDF_LEN); x = x.substring(0, x.length()-4); } else { return null; } k = x.indexOf("v"); if (k>0) { x = x.substring(0,k); } return x; }  static String url2num(String url); static String url2pdfUrl(String url); static String sldoc2arxivNum(SLDocument doc, SLModel mod);  }