Re: [NTG-context] Fwd: Fwd: IBM Wordcloud with the Filter Module

2019-03-14 Thread Aditya Mahajan

On Fri, 15 Mar 2019, Jeroen wrote:


I have installed portable java8 in /context/java, so paths will not be
needed when using absolute paths with the commands in these files. When I
execute the following batch file sample2.bat with a command on a single
line, it will create the sample2.png wordcould file as expected in the
/context/documents folder:

/context/java/bin/java -jar /context/wordcloud/ibm-word-cloud.jar -c
/context/wordcloud/examples/configuration.txt -w 800 -h 600 <
/context/wordcloud/examples/hamlet.txt > /context/documents/sample2.png

I now use this test2.tex file with filter with the defineexternalfilter
command on one line without crlf or spaces:

fonts   > 'fallback modern-designsize rm 12pt' is loaded
t-filter> current filter : wordcloud
t-filter> base file : test2-temp-wordcloud-0
t-filter> input file : test2-temp-wordcloud-0.tmp
t-filter> output file : test2-temp-wordcloud-0.png
t-filter> command : /context/java/bin/java -jar
/context/wordcloud/ibm-word-cloud.jar -c
/context/wordcloud/examples/configuration.txt -w 800 -h 600 -o
test2-temp-wordcloud-0.png -i test2-temp-wordcloud-0.tmp
t-filter> state :
t-filter> cached output file 'test2-temp-wordcloud-0.png' missing.
Rerunning filter
t-filter> file 'test2-temp-wordcloud-0.png' cannot be found
t-filter> current filter : wordcloud
t-filter> base file : test2-temp-wordcloud-0
t-filter> input file : test2-temp-wordcloud-0.tmp
t-filter> output file : test2-temp-wordcloud-0.png


Everything looks okay here, so I am not sure what is going wrong. Can you 
try if you can run other java programs, perhaps even setting


\usemodule[filter]
\traceexternalfilters
\defineexternalfilter[JAVA][filtercommand=java]

\starttext
\startJAVA
This is a test
\stopJAVA
\stoptext

and check the console output to see if you see messages that java is 
running (you should see the standard message about how to use java). If 
java is being called correctly, then the error is on the java end of 
things and I don't know how to debug that.


Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Fwd: Fwd: IBM Wordcloud with the Filter Module

2019-03-14 Thread Jeroen
I have installed portable java8 in /context/java, so paths will not be
needed when using absolute paths with the commands in these files. When I
execute the following batch file sample2.bat with a command on a single
line, it will create the sample2.png wordcould file as expected in the
/context/documents folder:

/context/java/bin/java -jar /context/wordcloud/ibm-word-cloud.jar -c
/context/wordcloud/examples/configuration.txt -w 800 -h 600 <
/context/wordcloud/examples/hamlet.txt > /context/documents/sample2.png

I now use this test2.tex file with filter with the defineexternalfilter
command on one line without crlf or spaces:

\usemodule[filter]


\defineexternalfilter[wordcloud][filtercommand={/context/java/bin/java -jar
/context/wordcloud/ibm-word-cloud.jar -c
/context/wordcloud/examples/configuration.txt -w 800 -h 600 -o
\externalfilteroutputfile\space -i \externalfilterinputfile},
output=\externalfilterbasefile.png, readcommand=\ExternalFigure,
continue=yes, read=yes, cache=yes, purge=no,]


\def\ExternalFigure#1{\externalfigure[#1]}


\traceexternalfilters


\starttext

\startwordcloud

Een bak cijfers vertalen naar een visuele weergave kan ervoor zorgen dat
statistische data beter gecommuniceerd wordt. Grafieken zijn zoals Tufte
(1997), een bekende auteur op het gebied van analytisch ontwerp, zegt
instruments for reasoning. Voordat het zover is zullen echter eerst een
paar stappen genomen moeten worden. Ervan uitgaande dat de bak met data al
verzameld is moet er gekeken worden welke cijfers met elkaar in verband
kunnen worden gebracht. Is er een ontwikkeling in tijd, zijn er
verschillen, is er een stijgende of dalende lijn in te ontdekken etcetra.
Door deze data te rangschikken en te ordenen kunnen deze patronen zichtbaar
gemaakt worden. Ontwikkelingen, schommelingen hierin, de frequentie
hiervan, onderlinge relaties en een totaaloverzicht kunnen in beeld
gebracht worden.

\stopwordcloud

\stoptext


and the created pdf file states "output file missing", and the following is
the test2.log file content:

open source > level 1, order 1, name
'C:/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2018.07.02 14:39 MKIV beta  fmt: 2018.9.28
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name
'C:/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > beware: some patches loaded from cont-new.mkiv
close source> level 2, order 2, name
'C:/context/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'test2', input './test2', result 'test2'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
system  > synctex functionality is enabled, expect 5-10 pct runtime
overhead!
open source > level 2, order 3, name 'C:/context/documents/test2.tex'
modules > 'filter' is loaded
open source > level 3, order 4, name
'C:/context/tex/texmf-modules/tex/context/third/filter/t-filter.mkiv'
loading > Filter (ver: 2018.08.10)
modules > 'module-catcodes' is loaded
open source > level 4, order 5, name
'C:/context/tex/texmf-modules/tex/context/third/filter/t-module-catcodes.mkiv'
loading > Module Catcodes (ver: 2018.04.16)
close source> level 4, order 5, name
'C:/context/tex/texmf-modules/tex/context/third/filter/t-module-catcodes.mkiv'
close source> level 3, order 5, name
'C:/context/tex/texmf-modules/tex/context/third/filter/t-filter.mkiv'
fonts   > preloading latin modern fonts (second stage)
fonts   > defining > source file
'D:/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf' is
not found
fonts   > defining > using source file
'C:/context/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf' due
to cache mismatch
fonts   > defining > source file
'D:/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf'
is not found
fonts   > defining > using source file
'C:/context/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf'
due to cache mismatch
fonts   > 'fallback modern-designsize rm 12pt' is loaded
t-filter> current filter : wordcloud
t-filter> base file : test2-temp-wordcloud-0
t-filter> input file : test2-temp-wordcloud-0.tmp
t-filter> output file : test2-temp-wordcloud-0.png
t-filter> command : /context/java/bin/java -jar
/context/wordcloud/ibm-word-cloud.jar -c
/context/wordcloud/examples/configuration.txt -w 800 -h 600 -o
test2-temp-wordcloud-0.png -i test2-temp-wordcloud-0.tmp
t-filter> state :
t-filter> cached output file 'test2-temp-wordcloud-0.png' missing.
Rerunning filter
t-filter> file 'test2-temp-wordcloud-0.png' cannot be found
t-filter> current filter : wordcloud
t-filter> base file : test2-temp-wordcloud-0
t-filter> input file :