Note that there are some explanatory texts on larger screens.

plurals
  1. POJButton run main method
    primarykey
    data
    text
    <p>I'm doing some text mining application. It consists of <code>TextRazor</code> API Java Swing. How can I use <code>JButton</code> to run <code>main()</code> class? Once the button is clicked, the code in <code>main()</code> class must be triggered. Below is the code, please help me.</p> <pre><code>private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { //I want the main class to be called here** } private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) { JOptionPane.showMessageDialog(null, "Completed Analysis!","Alert", 1); jButton5.setEnabled(false); jTextArea2.setEditable(false); jTextArea3.setEditable(false); } /** * @param args * @throws NetworkException */ public static void main(String[] args) throws NetworkException, AnalysisException { // Sample request, showcasing a couple of TextRazor features String API_KEY = "7d5066bec76cb47f4eb4e557c60e9b979f9a748aacbdc5a44ef9375a"; TextRazor client = new TextRazor(API_KEY); client.addExtractor("words"); client.addExtractor("entities"); client.addExtractor("entailments"); client.addExtractor("senses"); client.addExtractor("entity_companies"); String rules = "entity_companies(CompanyEntity) :- entity_type(CompanyEntity, 'Company')."; client.setRules(rules); AnalyzedText response = client.analyze("Barclays misled shareholders and the public RBS about one of the biggest investments in the bank's history, a BBC Panorama investigation has found."); for (Sentence sentence : response.getResponse().getSentences()) { for (Word word : sentence.getWords()) { System.out.println("----------------"); System.out.println("Word: " + word.getLemma()); for (Entity entity : word.getEntities()) { System.out.println("Matched Entity: " + entity.getEntityId()); } for (Sense sense: word.getSenses()) { System.out.println("Word sense: " + sense.getSynset() + " has score: " + sense.getScore()); } } } // Use a custom rule to match 'Company' type entities for (Custom custom : response.getResponse().getCustomAnnotations()) { for (Custom.BoundVariable variable : custom.getContents()) { if (null != variable.getEntityValue()) { for (Entity entity : variable.getEntityValue()) { System.out.println("Variable: " + variable.getKey() + " Value:" + entity.getEntityId()); } } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload