About: Word frequency statistics for a file   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Procedure: * In Vim, copy the code shown below, then enter :@" to execute it (or put the code in your vimrc). * Press V then move the cursor to select the lines whose words you want to count. * Alternatively, select no lines, in which case all words in the buffer will be counted. * Type :WordFrequency and press Enter. A new window will open with a scratch buffer showing the word frequencies.

AttributesValues
rdfs:label
  • Word frequency statistics for a file
rdfs:comment
  • Procedure: * In Vim, copy the code shown below, then enter :@" to execute it (or put the code in your vimrc). * Press V then move the cursor to select the lines whose words you want to count. * Alternatively, select no lines, in which case all words in the buffer will be counted. * Type :WordFrequency and press Enter. A new window will open with a scratch buffer showing the word frequencies.
Version
  • 7(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 1530(xsd:integer)
Category
  • Advanced Regex
Author
  • vale.smth
Subpage
  • /200712
Complexity
  • basic
Created
  • 2007(xsd:integer)
ID
  • 1531(xsd:integer)
NEXT
  • 1532(xsd:integer)
abstract
  • Procedure: * In Vim, copy the code shown below, then enter :@" to execute it (or put the code in your vimrc). * Press V then move the cursor to select the lines whose words you want to count. * Alternatively, select no lines, in which case all words in the buffer will be counted. * Type :WordFrequency and press Enter. A new window will open with a scratch buffer showing the word frequencies. function! WordFrequency() range let all = split(join(getline(a:firstline, a:lastline)), '\A\+') let frequencies = {} for word in all let frequencies[word] = get(frequencies, word, 0) + 1 endfor new setlocal buftype=nofile bufhidden=hide noswapfile tabstop=20 for [key,value] in items(frequencies) call append('$', key." ".value) endfor sort i endfunction command! -range=% WordFrequency ,call WordFrequency()
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software