public static synchronized SubjectivityLexicon getInstance() { if (instance == null) { final String location = Objects.firstNonNull( Environment.getProperty("subjectivity.lexicon.home"), "SubjectivityLexicon.tsv"); try { instance = Lexicon.readFrom(SubjectivityLexicon.class, Lexeme.class, location); } catch (final Throwable ex) { throw new Error("Could not read default subjectivity lexicon at " + location, ex); } } return instance; }
private static String readPluginDocs() { final Map<String, String> descriptions = Environment.getPlugins(Runnable.class); final List<String> names = new ArrayList<String>(descriptions.keySet()); Collections.sort(names); final StringBuilder builder = new StringBuilder(); for (final String name : names) { builder.append(builder.length() == 0 ? "" : "\n\n"); builder.append(descriptions.get(name).trim()); } return builder.toString(); }
"Processed %d NAF files (%d NAF/s, %d NAF/s avg)"); final int numThreads = Environment.getCores(); final CountDownLatch latch = new CountDownLatch(numThreads); final AtomicInteger counter = new AtomicInteger(0); tracker.start(); for (int i = 0; i < numThreads; ++i) { Environment.getPool().submit(new Runnable() {
process.getErrorStream())); Environment.getPool().submit(new Runnable() {
try { final String command = args[index]; runnable = Environment.newPlugin(Runnable.class, command, Arrays.copyOfRange(args, index + 1, args.length)); } catch (final IllegalArgumentException ex) {
public static synchronized Intensities getInstance() { if (instance == null) { final String location = Objects.firstNonNull( Environment.getProperty("intensities.home"), "intensities.tsv"); try { instance = Lexicon.readFrom(Intensities.class, Lexeme.class, location); } catch (final Throwable ex) { throw new Error("Could not read default intensity lexicon at " + location, ex); } } return instance; }
public static synchronized SenticNet getInstance() { if (instance == null) { final String location = Objects.firstNonNull( Environment.getProperty("senticnet.home"), "SenticNet.tsv"); try { instance = Lexicon.readFrom(SenticNet.class, Lexeme.class, location); } catch (final Throwable ex) { throw new Error("Could not read default subjectivity lexicon at " + location, ex); } } return instance; }
final String rulesetNames = options.getOptionArg("r", String.class); for (final String rulesetName : rulesetNames.split(",")) { String location = Environment.getProperty("rdfpro.rules." + rulesetName); location = location != null ? location : rulesetName; rulesetURLs.add(IO.extractURL(location).toString());