@Test void testRun() { String slugifiedText = Slugifier.run("Lenovo Y520 i7-7700HQ 16GB 1TB+256SSD GTX1050 Win10 80WK004JTX"); assertEquals("", slugifiedText); }
public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); normalizedText = normalizedText.replaceAll(" ", "-"); normalizedText = normalizedText.toLowerCase(); toReturn = URLEncoder.encode(normalizedText, "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, "Exception on slugify", e); } return toReturn; }
Slugifier { public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); normalizedText = normalizedText.replaceAll(" ", "-"); normalizedText = normalizedText.toLowerCase(); toReturn = URLEncoder.encode(normalizedText, "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, "Exception on slugify", e); } return toReturn; } }
Slugifier { public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); normalizedText = normalizedText.replaceAll(" ", "-"); normalizedText = normalizedText.toLowerCase(); toReturn = URLEncoder.encode(normalizedText, "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, "Exception on slugify", e); } return toReturn; }  }
Slugifier { public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); normalizedText = normalizedText.replaceAll(" ", "-"); normalizedText = normalizedText.toLowerCase(); toReturn = URLEncoder.encode(normalizedText, "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, "Exception on slugify", e); } return toReturn; }  static String run(String text); static String convertCharactersFromTurkishToEnglish(String text); static void main(String[] args); }
Slugifier { public static String run(String text) { if (text == null || text.length() == 0) { return ""; } String toReturn = ""; try { String normalizedText = normalize(text); normalizedText = normalizedText.replaceAll("[^\\w\\s\\-]", ""); normalizedText = normalizedText.replaceAll(" ", "-"); normalizedText = normalizedText.toLowerCase(); toReturn = URLEncoder.encode(normalizedText, "UTF-8"); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, "Exception on slugify", e); } return toReturn; }  static String run(String text); static String convertCharactersFromTurkishToEnglish(String text); static void main(String[] args);  }