<commit_before>#!/usr/bin/gjs
// Runs a task in a separate process.

const path = /^.*?@(.*):/.exec(new Error().stack)[1];
const dirname = imports.gi.Gio.File.new_for_path(path).get_parent().get_parent().get_path();
imports.searchPath.push(dirname);
new imports.src.app.Gjs.Require.Require().require();
new imports.src.app.Gjs.GtkDom.GtkDom().require();

const { Worker } = require("../src/app/Gio/Worker");
const worker = new Worker(JSON.parse(ARGV[0]), (action) => {
  print(JSON.stringify(action));
});
worker.run();<commit_msg>Worker: Fix run from global install<commit_after>#!/usr/bin/gjs
// Runs a task in a separate process.

const path = /^.*?@(.*):/.exec(new Error().stack)[1];
const modules = imports.gi.Gio.File.new_for_path(path).get_parent().get_parent().get_parent().get_path();
imports.searchPath.push(modules);
const dirname = imports.gi.Gio.File.new_for_path(path).get_parent().get_parent().get_path();
imports.searchPath.push(dirname);
new imports.src.app.Gjs.Require.Require().require();
new imports.src.app.Gjs.GtkDom.GtkDom().require();

const { Worker } = require("../src/app/Gio/Worker");
const worker = new Worker(JSON.parse(ARGV[0]), (action) => {
  print(JSON.stringify(action));
});
worker.run();
{'fraction_non_alphanumeric': 0.21241830065359477, 'fraction_numerical': 0.0032679738562091504, 'mean_word_length': 5.4136125654450264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5470794', 'n_tokens_mistral': 441, 'n_tokens_neox': 438, 'n_words': 68}