String 으로 긴~ 문자를 받아왔습니다
예를 들어 "오늘 저녁 7시에 동성로의 로데오거리에서 뵙겠습니다" 라는 단어를 들고와서
이중에 "저녁", "7시" , "동성로", "로데오거리" 이렇게 중요 단어만 추출할려는데
이렇게 특정단어만을 인식하는 api 가 따로 있을까요??
일단 저는 필요단어자체를 String으로 다시 만들어서 그 단어를 체크하여 그단어가 있을때 받아오도록은 만들었는데 엄청나게 많은 양의 단어들을 전부 String으로 받아오기는 말이 안되는거 같아서 다른방법이 있나 궁금합니다
public class CheckMain extends Activity {
String str = "오늘 저녁 일곱시에 동성로에서 봅시다.";
TextView text1;
TextView text2;
String dong = "동성로";
String one = "한시";
String two = "두시";
String result = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_check_main);
text1 = (TextView)findViewById(R.id.textView1);
text2 = (TextView)findViewById(R.id.textView2);
boolean value = str.contains(dong);
if(value == true) {
result = dong;
}
text1.setText(result);
}
}