private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
String readPOS;
readPOS = jTextArea1.getText();
String []POS;
POS = readPOS.split("[-.!? ]");
jTextArea2.append("Part of Speech Result:\n");
for(int i = 0; i < POS.length; i++)
{
if (POS[i].equals("makan")||POS[i].equals("kerja"))
{
jTextArea2.append((POS[i] + "/KK" + " | "));
}
else if (POS[i].equals("sakit")||POS[i].equals("cantik"))
{
jTextArea2.append((POS[i] + "/KS" + " | "));
}
else if (POS[i].equals("saya")||POS[i].equals("dia"))
{
jTextArea2.append((POS[i] + "/KGN" + " | "));
}
else if (POS[i].equals("bapa")||POS[i].equals("isteri")
||POS[i].equals("doktor")||POS[i].equals("encik")||POS[i].equals("nasi"))
{
jTextArea2.append((POS[i] + "/KNA" + " | "));
}
else if (POS[i].equals("Ali")||POS[i].equals("Dr.")||POS[i].equals("En."))
{
jTextArea2.append((POS[i] + "/KNK" + " | "));
}
else if (POS[i].equals("dan")||POS[i].equals("atau"))
{
jTextArea2.append((POS[i] + "/KPA" + " | "));
}
else if (POS[i].equals("nya")||POS[i].equals("an")||POS[i].equals("kah"))
{
jTextArea2.append((POS[i] + "/KPC" + " | "));
}
else if (POS[i].equals("mengapa")||POS[i].equals("adapun")
||POS[i].equals("aduh")||POS[i].equals("sila"))
{
jTextArea2.append((POS[i] + "/KPK" + " | "));
}
else
jTextArea2.append((POS[i] + "/KNK" + " | "));
}jTextArea2.append("\n\n\n");
// TODO add your handling code here:
}
can i simplify (POS.equals("mengapa")||POS.equals("adapun")
||POS.equals("aduh")||POS.equals("sila"))?? because i still have alot of OR need to put in. By tis problem i can use database??? anyone can tell me? thanks.