G
G
gtir2021-10-18 22:47:00
Software and Internet Services
gtir, 2021-10-18 22:47:00

Programs / sites that calculate the number of repetitions of a word in a project and display a list of all words with an indication of the number of repetitions?

Мне нужно узнать какие функции и методы, свои собственные методы и функции, ключевые слова языка/фреймворка/библиотеки чаще всего используются в файлах моих проектов.

Ищу программу в которой я открою директорию своего проекта или сайт куда я загружу директорию с проектом и мне отобразит список всех слов и количество повторений, например:

1. function 57 повторений
2. if 42 повторений
3. dispatch 33 повторений
......
1372. fetchData 1 повторение

ИЛИ хотя бы:
Программу или сайт в в которые я буду копировать поочередно текст из файлов и получу список всех слов и количество повторений этих слов в файле, текст которого скопировал и вставил в данную программу/сайт.

Есть ли какие-то такие программы/сайты? Желательно бесплатные.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-10-18
@gtir

Can be done with hand tools. the same command line.
For example, the top 10 words of a certain Python project:

find ./ -type f -name "*.py" -exec cat {} \; |  sed 's/ /\n/g' | grep -o -E '[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW]+' | sort | uniq -c  | sort -nr | head -n 10
   4133 self
   3383 name
   2669 user
   2525 models
   2258 import
   2172 get
   2103 status
   2053 True
   1971 from
   1890 response

in short - look for all *.py files, output to the console, divide by delimiter, clean lines, sort, display unique values ​​with counting, sort by frequency and display the first 10 records.
Can be tweaked a bit to suit your specific needs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question