title: Problems with converting text to .arff in Weka
body: <p>I am trying to convert a text file with 1000 social media post for sentiment analysis purposes using Weka SimpleCLI using : java weka.core.converters.TextDirectoryLoader -dir /directory/with/your/text/files > output.arff</p>
  
  <p>However I get an exception. Does anyone know what the problem is? Screenshot is in the link. </p>
  
  <p><a href="https://i.stack.imgur.com/LZ7h9.png" rel="nofollow noreferrer">Screenshot of the exception</a></p>
  
  <p>CODE: </p>
  
  <pre><code>&gt; java weka.core.converters.TextDirectoryLoader -dir /Users/Nenad/Desktop/Sentiment &gt; sentiment.arff
  
  @relation C__Users_Nenad_Desktop_Sentiment
  
  @attribute text string
  @attribute @@class@@ {}
  
  @data
  
  java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      java.util.ArrayList.rangeCheck(Unknown Source)
      java.util.ArrayList.get(Unknown Source)
      weka.core.converters.TextDirectoryLoader.getNextInstance(TextDirectoryLoader.java:568)
      weka.core.converters.TextDirectoryLoader.run(TextDirectoryLoader.java:693)
      weka.core.converters.TextDirectoryLoader.main(TextDirectoryLoader.java:654)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      java.lang.reflect.Method.invoke(Unknown Source)
      weka.gui.SimpleCLIPanel$ClassRunner.run(SimpleCLIPanel.java:328)
  
      at java.util.ArrayList.rangeCheck(Unknown Source)
      at java.util.ArrayList.get(Unknown Source)
      at weka.core.converters.TextDirectoryLoader.getNextInstance(TextDirectoryLoader.java:568)
      at weka.core.converters.TextDirectoryLoader.run(TextDirectoryLoader.java:693)
      at weka.core.converters.TextDirectoryLoader.main(TextDirectoryLoader.java:654)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at weka.gui.SimpleCLIPanel$ClassRunner.run(SimpleCLIPanel.java:328)
  </code></pre>