Saturday, August 10, 2019

The Death of a Workhorse


was it day before yesterday that I woke up and these words came to my mind: “… after many a summer dies the swan.”?  Not difficult to find that it was a novel by Huxley who took the name from Tennyson, who took the theme from Tithonus “a figure in Greek mythology to whom Aurora gave eternal life but not eternal youth”.
From the beginning of this year, Microsoft kept warning me about the termination of their support for the Windows-7 system by 2020. I had been using my Samsung laptop RC510 since 2011 as my workhorse and a companion. Lately it was becoming harder and harder to restart and took a lot of system repairs or restores every time to work. Suddenly one morning last week, it went dead or almost dead. Windows own repair nor restore could bring it back any longer. Then I found out that Samsung has factory reset or restore facility for all its PCs and using it I almost recovered my laptop. But something went wrong and I am laying it off, though I think I still have chances and would work on it.
On the other hand my most precious work of doing NLP recently had partly been backed up. I still need to recover my work for the last five or six posts on my blog. But as I have all my essential work posted, it was not difficult to put them back into RStudio and recover the RMD files. I did that on my reserve Lenovo 32-bit laptop with AMD processor, and 2GB RAM.
I was worried that my Lenovo would not be able to handle the NLP work done by my workhorse laptop, the Samsung RC510, a 64-bit machine with Core I5 processor, and 8GB of RAM. Fortunately, it could, though much slower! For example the following code chunk from my last post
library(quanteda)
library(stringr)
system.time(
  x100_iwpN.2 <- sapply(x100_itNS5.w_paliN, paste0, collapse=" ") %>%
    word(.,-2,-1)
)
took just 18.91 seconds on the Samsung laptop, but 81.00 seconds on the Lenovo! For all the codes chunks in four Cycle3 series of post, there was no difficulty in running with Lenovo except in the case of wordcloud generations for the last post. The difficulty here is that “Myanmar3” font could not be installed.
library(extrafont)
Registering fonts with R
font_import(pattern="Myanmar3.ttf")
Scanning ttf files in C:\Windows\Fonts ...
Extracting .afm files from .ttf files...
C:\Windows\Fonts\Myanmar3.ttfError in system2(ttf2pt1, c(args, shQuote(ttfiles[i]), shQuote(tmpfiles[i])),  : 
  'CreateProcess' failed to run 'C:\Users\T10user\DOCUME~1\R\R-36~1.1\library\Rttf2pt1\exec\ttf2pt1.exe -a -G fAe "C:\Windows\Fonts\Myanmar3.ttf" "C:\Users\T10user\AppData\Local\Temp\RtmpIVpTvi/fonts/Myanmar3"'
I searched on the Web for this problem and came to understand that this is somehow associated with 32-bit PCs with Windows-7. I couldn’t find a solution as yet. I also installed the latest Myanmar Unicode font “Pyidaungsu.ttf” which will go official as of October, this year. No success.
If I don’t specify the font, the result is:
set.seed(2307)
textplot_wordcloud(x100_iwpN2.dfm, min_size = .9, max_size = 13, min_count = 30, color = RColorBrewer::brewer.pal(8, "Dark2"))
However, I still have an ASUS Vivotab Smart (Windows) tablet, a 32-bit machine with 1.80GHz Atom processor, 2GB RAM, with Windows 8.1 system. In all aspects this runs as well as the Lenovo laptop, but it cannot import the “Myanmar3” font also. However, when I tried running it without specifying the font exactly as in the above code chunk, it gives the wordcloud perfectly!