Skip to content

Instantly share code, notes, and snippets.

@mahimrocky
Created December 12, 2018 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mahimrocky/ec115e7a0a6c1af85d1bb9213ad22808 to your computer and use it in GitHub Desktop.
Save mahimrocky/ec115e7a0a6c1af85d1bb9213ad22808 to your computer and use it in GitHub Desktop.
Reading or detecting name from string
public String readName(String cnt[]) {
String sd = "";
Span sp[] = nameFinderME.find(cnt);
String a[] = Span.spansToStrings(sp, cnt);
StringBuilder fd = new StringBuilder();
int l = a.length;
for (int j = 0; j < l; j++) {
fd = fd.append(a[j] + "\n");
}
sd = fd.toString();
return sd;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment