# NOT RUN {
# x is a list
x=list('W-A for an English-Persian Parallel Corpus (Mizan).','ALIGNMENT is a link between words.')
nfirst2lower(x, n=8) ## nfirst2lower(x, n=8) is not a list
y='MT is the automatic translation. SMT is one of the methods of MT.'
nfirst2lower(y) # only run for the first sentence
u1=unlist(strsplit(y, ". ", fixed = TRUE))
sapply(1:length(u1),function(x)nfirst2lower(u1[x])) ## run for all sentences
h = 'It is a METHOD for this function.'
nfirst2lower (h, second = TRUE) #only run for the first word
h1 = strsplit(h, ' ')[[1]]
nfirst2lower(h1, second = TRUE) # run for all words
# }
Run the code above in your browser using DataLab