* [Comm] информация о документе @ 2005-01-18 11:28 Aleksey 2005-01-18 11:33 ` [Comm] " Michael Shigorin 0 siblings, 1 reply; 11+ messages in thread From: Aleksey @ 2005-01-18 11:28 UTC (permalink / raw) To: Community [-- Attachment #1: Type: text/plain, Size: 141 bytes --] Кто нибудь знает как можно: - посчитать количество слов в текстовом файле? - посчитать частоту встречаемости слова в процентах? -- $respect [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Comm] Re: информация о документе 2005-01-18 11:28 [Comm] информация о документе Aleksey @ 2005-01-18 11:33 ` Michael Shigorin 2005-01-18 11:38 ` Max A Mazin 0 siblings, 1 reply; 11+ messages in thread From: Michael Shigorin @ 2005-01-18 11:33 UTC (permalink / raw) To: Community On Tue, Jan 18, 2005 at 02:28:26PM +0300, Aleksey wrote: > - посчитать количество слов в текстовом файле? wc -w > - посчитать частоту встречаемости слова в процентах? Относительно слов? Кажется, это было одним из эталонных заданий на pleac.sf.net, подберите для любимого языка. -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-18 11:33 ` [Comm] " Michael Shigorin @ 2005-01-18 11:38 ` Max A Mazin 2005-01-18 12:36 ` Aleksey E Birukov 0 siblings, 1 reply; 11+ messages in thread From: Max A Mazin @ 2005-01-18 11:38 UTC (permalink / raw) To: Community В сообщении от 18 Январь 2005 14:33 Michael Shigorin написал(a): > On Tue, Jan 18, 2005 at 02:28:26PM +0300, Aleksey wrote: > > - посчитать количество слов в текстовом файле? > > wc -w > > > - посчитать частоту встречаемости слова в процентах? > > Относительно слов? Кажется, это было одним из эталонных заданий > на pleac.sf.net, подберите для любимого языка. Керниган, Пайк "Среда программирования UNIX" -- Max A Mazin (__Mah__@mail.ru) ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-18 11:38 ` Max A Mazin @ 2005-01-18 12:36 ` Aleksey E Birukov 2005-01-18 22:03 ` Alexey Rusakov 0 siblings, 1 reply; 11+ messages in thread From: Aleksey E Birukov @ 2005-01-18 12:36 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 611 bytes --] В сообщении от Вторник 18 Январь 2005 14:38 Max A Mazin написал(a): > В сообщении от 18 Январь 2005 14:33 Michael Shigorin написал(a): > > On Tue, Jan 18, 2005 at 02:28:26PM +0300, Aleksey wrote: > > > - посчитать количество слов в текстовом файле? > > > > wc -w > > > > > - посчитать частоту встречаемости слова в процентах? > > > > Относительно слов? Кажется, это было одним из эталонных заданий > > на pleac.sf.net, подберите для любимого языка. что-то не видно, продолжаю поиск... > > Керниган, Пайк "Среда программирования UNIX" может есть в электронном виде? (парсинг google ничего не дал) -- $respect [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-18 12:36 ` Aleksey E Birukov @ 2005-01-18 22:03 ` Alexey Rusakov 2005-01-19 7:27 ` Dmytro O. Redchuk ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: Alexey Rusakov @ 2005-01-18 22:03 UTC (permalink / raw) To: community Aleksey E Birukov wrote: >>>>- посчитать частоту встречаемости слова в процентах? >>>> >>>> >>>Относительно слов? Кажется, это было одним из эталонных заданий >>>на pleac.sf.net, подберите для любимого языка. >>> >>> >что-то не видно, продолжаю поиск... > > >>Керниган, Пайк "Среда программирования UNIX" >> >> >может есть в электронном виде? (парсинг google ничего не дал) > > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? $((`grep -c слово файл` * 100.0 / `wc -w <файл`)) -- Alexey "Ktirf" Rusakov ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-18 22:03 ` Alexey Rusakov @ 2005-01-19 7:27 ` Dmytro O. Redchuk 2005-01-19 7:36 ` Alexey Rusakov 2005-01-19 7:49 ` Michael Shigorin 2005-01-19 10:10 ` Вячеслав Диконов 2 siblings, 1 reply; 11+ messages in thread From: Dmytro O. Redchuk @ 2005-01-19 7:27 UTC (permalink / raw) To: community On Wed, Jan 19, 2005 at 01:03:18AM +0300, Alexey Rusakov wrote: > > Aleksey E Birukov wrote: > > >>>>- посчитать частоту встречаемости слова в процентах? > >>>> > >>>> > >>>Относительно слов? Кажется, это было одним из эталонных заданий > >>>на pleac.sf.net, подберите для любимого языка. > >>> > >>> > >что-то не видно, продолжаю поиск... > > > > > >>Керниган, Пайк "Среда программирования UNIX" > >> > >> > >может есть в электронном виде? (парсинг google ничего не дал) > > > > > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? > > $((`grep -c слово файл` * 100.0 / `wc -w <файл`)) 8-) Класно. Можно даже $[`grep -cE 'слово1|слово2' файл` * 100.0 / `wc -w <файл`], можно много файлов... Только у меня bash ругается на десятичную точку. Ман пока не читал %) > > -- > Alexey "Ktirf" Rusakov > -- _,-=._ /|_/| `-.} `=._,.-=-._., @ @._, `._ _,-. ) _,.-' ` G.m-"^m`m' Dmytro O. Redchuk ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-19 7:27 ` Dmytro O. Redchuk @ 2005-01-19 7:36 ` Alexey Rusakov 0 siblings, 0 replies; 11+ messages in thread From: Alexey Rusakov @ 2005-01-19 7:36 UTC (permalink / raw) To: community Dmytro O. Redchuk wrote: >>Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? >> >>$((`grep -c слово файл` * 100.0 / `wc -w <файл`)) >> >> >8-) > >Класно. > >Можно даже $[`grep -cE 'слово1|слово2' файл` * 100.0 / `wc -w <файл`], >можно много файлов... > > >Только у меня bash ругается на десятичную точку. Ман пока не читал %) > > Сделайте побольше нулей, сколько вам надо точности. Вместо 100.0 умножьте на 10000, он вам посчитает проценты с двумя знаками после запятой (в целом виде, правда). -- Alexey "Ktirf" Rusakov ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Comm] Re: информация о документе 2005-01-18 22:03 ` Alexey Rusakov 2005-01-19 7:27 ` Dmytro O. Redchuk @ 2005-01-19 7:49 ` Michael Shigorin 2005-01-19 7:58 ` Dmytro O. Redchuk 2005-01-19 10:10 ` Вячеслав Диконов 2 siblings, 1 reply; 11+ messages in thread From: Michael Shigorin @ 2005-01-19 7:49 UTC (permalink / raw) To: community On Wed, Jan 19, 2005 at 01:03:18AM +0300, Alexey Rusakov wrote: > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? > $((`grep -c слово файл` * 100.0 / `wc -w <файл`)) Недооцениваете. Hint: эта строчка считает помидоров, делённых на крокодилов. -- ---- WBR, Michael Shigorin <mike@altlinux.ru> ------ Linux.Kiev http://www.linux.kiev.ua/ ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-19 7:49 ` Michael Shigorin @ 2005-01-19 7:58 ` Dmytro O. Redchuk 0 siblings, 0 replies; 11+ messages in thread From: Dmytro O. Redchuk @ 2005-01-19 7:58 UTC (permalink / raw) To: community On Wed, Jan 19, 2005 at 09:49:04AM +0200, Michael Shigorin wrote: > On Wed, Jan 19, 2005 at 01:03:18AM +0300, Alexey Rusakov wrote: > > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? > > $((`grep -c слово файл` * 100.0 / `wc -w <файл`)) > > Недооцениваете. > > Hint: эта строчка считает помидоров, делённых на крокодилов. Та это неважно, Михаил!-) Именно как "прикол" это выглядит достаточно убедительно :) Кстати, его можно и развить :) (да, всё равно это прикол) > > -- > ---- WBR, Michael Shigorin <mike@altlinux.ru> > ------ Linux.Kiev http://www.linux.kiev.ua/ -- _,-=._ /|_/| `-.} `=._,.-=-._., @ @._, `._ _,-. ) _,.-' ` G.m-"^m`m' Dmytro O. Redchuk ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-18 22:03 ` Alexey Rusakov 2005-01-19 7:27 ` Dmytro O. Redchuk 2005-01-19 7:49 ` Michael Shigorin @ 2005-01-19 10:10 ` Вячеслав Диконов 2005-01-19 10:19 ` Aleksey E Birukov 2 siblings, 1 reply; 11+ messages in thread From: Вячеслав Диконов @ 2005-01-19 10:10 UTC (permalink / raw) To: community В Срд, 19/01/2005 в 01:03 +0300, Alexey Rusakov пишет: > Aleksey E Birukov wrote: > > >>>>- посчитать частоту встречаемости слова в процентах? > >>Керниган, Пайк "Среда программирования UNIX" > >может есть в электронном виде? (парсинг google ничего не дал) > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? Задача не так уж и проста. 1) не все разделённые пробелами последовательности символов - слова. Есть языки, где слова вообще не разделяются. Есть сложносоставные слова. 2) Большинство слов имеет много форм. Особенно актуально для русского. В общем, для этого нужен морфологический анализатор и очень представительный морфологический словарь. Сделать программу, удовлетворительно решающую такую задачу можно, но добиться 100% точности и универсальности - теоретически нельзя. -- Вячеслав Диконов <linuxbox@degunino.net> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Comm] Re: информация о документе 2005-01-19 10:10 ` Вячеслав Диконов @ 2005-01-19 10:19 ` Aleksey E Birukov 0 siblings, 0 replies; 11+ messages in thread From: Aleksey E Birukov @ 2005-01-19 10:19 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 1178 bytes --] В сообщении от Среда 19 Январь 2005 13:10 Вячеслав Диконов написал(a): > В Срд, 19/01/2005 в 01:03 +0300, Alexey Rusakov пишет: > > Aleksey E Birukov wrote: > > >>>>- посчитать частоту встречаемости слова в процентах? > > >> > > >>Керниган, Пайк "Среда программирования UNIX" > > > > > >может есть в электронном виде? (парсинг google ничего не дал) > > > > Я что-то не пойму, вы прикалываетесь или я недооцениваю сложность задачи? > > Задача не так уж и проста. 1) не все разделённые пробелами > последовательности символов - слова. Есть языки, где слова вообще не > разделяются. Есть сложносоставные слова. 2) Большинство слов имеет много > форм. Особенно актуально для русского. > > В общем, для этого нужен морфологический анализатор и очень > представительный морфологический словарь. Сделать программу, > удовлетворительно решающую такую задачу можно, но добиться 100% точности > и универсальности - теоретически нельзя. Вобще, конечно, эту задачу пытаются решить поисковики с морфологией типа Яндекса. Вот скрипт, который делает примерно то, что мне надо: http://www.promolab.ru/free/parser.php Только разработка, к сожалению, закрытая. До GPL не доросли :) -- $respect [-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2005-01-19 10:19 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-01-18 11:28 [Comm] информация о документе Aleksey 2005-01-18 11:33 ` [Comm] " Michael Shigorin 2005-01-18 11:38 ` Max A Mazin 2005-01-18 12:36 ` Aleksey E Birukov 2005-01-18 22:03 ` Alexey Rusakov 2005-01-19 7:27 ` Dmytro O. Redchuk 2005-01-19 7:36 ` Alexey Rusakov 2005-01-19 7:49 ` Michael Shigorin 2005-01-19 7:58 ` Dmytro O. Redchuk 2005-01-19 10:10 ` Вячеслав Диконов 2005-01-19 10:19 ` Aleksey E Birukov
ALT Linux Community general discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 community community/ http://lore.altlinux.org/community \ mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com public-inbox-index community Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.community AGPL code for this site: git clone https://public-inbox.org/public-inbox.git