Coder Social home page Coder Social logo

Comments (9)

rhdekker avatar rhdekker commented on July 23, 2024

The Nashorn JavaScript Engine has been removed from recent versions of Java, which breaks CollateX. You will need JDK8 for Mac M1, which you can find here: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk#zulu (bottom of the page).

from collatex.

mboursnell avatar mboursnell commented on July 23, 2024

OK, thanks. I installed JDK8 (see image attached), but it doesn't seem to have helped...

Mike@MIKEs-M1-iMac collateX % java --version
java 16.0.1 2021-04-20
Java(TM) SE Runtime Environment (build 16.0.1+9-24)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing)
Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar song_trees_55_files.json
Unexpected error
null
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar song_trees_55_files.json A B
Error while parsing command line arguments (-h for usage instructions)
Invalid resource: A
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar (song_trees_55_files.json A B)
zsh: unknown group
Mike@MIKEs-M1-iMac collateX %

Screenshot 2023-09-01 at 18 23 04

from collatex.

rhdekker avatar rhdekker commented on July 23, 2024

You are half way there. It's still calling on the previously installed version of Java (16), instead of 8. Follow the "Set JAVA_HOME environment variable" instructions listed in this guide, https://dev.to/shane/configure-m1-mac-to-use-jdk8-with-maven-4b4g That should fix the problem.

from collatex.

rhdekker avatar rhdekker commented on July 23, 2024

If you want more background information on setting your JAVA_HOME variable, see here: https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-macos

from collatex.

mboursnell avatar mboursnell commented on July 23, 2024

That works! Thanks.

How do you select two of the four witnesses? I tried various things... What is the syntax?

Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json
{"witnesses":["A","B","C","D"],"table":[[["A "],["A "],["A "],["A "]],[["black "],["black "],["striped "],["striped "]],[["cat ","in ","a "],["cat ","in ","a "],["cat ","in ","a "],["cat ","in ","a "]],[["black "],["black "],["black "],["white "]],[["basket"],["basket"],["basket"],["basket"]]]}%
Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json A B
Error while parsing command line arguments (-h for usage instructions)
Invalid resource: A
Mike@MIKEs-M1-iMac collateX %

from collatex.

rhdekker avatar rhdekker commented on July 23, 2024

Glad to hear that it worked. As far as I remember there is no witness selection syntax. You can either pre filter the input before sending it to CollateX or post process the output. The idea is that the JSON is already a derivative of some other input file or files, like plain text, XML or a database.

from collatex.

mboursnell avatar mboursnell commented on July 23, 2024

OK, thanks. That'll be fine. I can work with that. Looking forward to trying it...

But the help suggests that you can (or have I misread it? I'm not sure what "|" and "(" mean)

Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar -h
usage: collatex []
(<json_input> | <witness_1> <witness_2> [[<witness_3>] ...])
-a,--algorithm progressive alignment algorithm to
use 'dekker' (default), 'medite',
'needleman-wunsch'
-cp,--context-path URL base/context path of the
service, default: '/'
-dot,--dot-path path to Graphviz 'dot',
auto-detected by default
-f,--format result/output format: 'json', 'csv',
'dot', 'graphml', 'tei'
-h,--help print usage instructions
-ie,--input-encoding charset to use for decoding non-XML
witnesses; default: UTF-8
-mcs,--max-collation-size maximum number of characters
(counted over all witnesses) to
perform collations on, default:
unlimited
-mpc,--max-parallel-collations maximum number of collations to
perform in parallel, default: 2
-o,--output output file; '-' for standard output
(default)
-oe,--output-encoding charset to use for encoding the
output; default: UTF-8
-p,--port HTTP port to bind server to,
default: 7369
-s,--script ECMA/JavaScript resource with
functions to be plugged into the
alignment algorithm
-S,--http start RESTful HTTP server
-t,--tokenized consecutive matches of tokens will
not be joined to segments
-xml,--xml-mode witnesses are treated as XML
documents
-xp,--xpath XPath 1.0 expression evaluating to
tokens of XML witnesses; default:
'//text()'

from collatex.

rhdekker avatar rhdekker commented on July 23, 2024

What I think is meant is that you can either supply a single JSON file that supplies all the witnesses or a list of file names of plain text files. As in java -jar collatex-tools-1.7.1.jar plain_text_witness1.txt witness2.txt witness3.txt

from collatex.

mboursnell avatar mboursnell commented on July 23, 2024

Ah! I see. Thanks.
Thanks for all your help.
I'll try using it now.

from collatex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.