Dear all,

I just started to play with Vega, a great Julia package for visualization,
developed by John Myles ( http://johnmyleswhite.github.io/Vega.jl ). One of
the features I like more is the wordcloud (
http://johnmyleswhite.github.io/Vega.jl/wordcloud.html).

I could easily reproduce the example he put in the webpage, in which the
text to be processed is defined as a the following:

>> corpus = [ "Julia is a high-level, high-performance dynamic programming
language for technical computing,...", "Julia programs are organized around
multiple dispatch; by defining functions and overloading them ..." ]

>> wc = wordcloud(x = corpus)

Now I would like to read a text from an ascii file. My first try was to
read an ascii file using the command readdlm. As follows:

>> corpus = readdlm("./textfile.txt",'\n');

(you can find the file textfile.txt here:
https://github.com/cndesantana/filestoshare/blob/master/textfile.txt)

The function used to build the wordcloud (wordcloud) asks as input an
AbstractVector. However, when I read the text using readdlm the variable
corpus is an Array{Any,2}. So, when I call the function wordcloud I have
the following (expected) error message:

>> wc = wordcloud(x = corpus)
ERROR: TypeError: typeassert: expected AbstractArray{T,1}, got Array{Any,2}

Do you have any suggestion about how to convert an Array{Any,2} to an
AbstractVector? Or how to read a text file to an AbstractVector variable?

Thanks for your attention and for any tip!

Best,

Charles
-- 
Um axé! :)

--
Charles Novaes de Santana, PhD
http://www.imedea.uib-csic.es/~charles

Reply via email to