Re: counting the same words within a song added by a user using Django

2021-07-12 Thread RaviKiran Kk
We are looking for django developer
Plz contact 6309620745

On Mon, Jul 5, 2021, 17:07 DJANGO DEVELOPER  wrote:

> Hi there.
> I am developing a project based on adding songs to the user's library and
> to the home page.
> other users can also purchase the songs like wise people do shopping on
> eCommerce stores.
> *Problem:(Question)*
> The problem that I want to discuss here is that when a user adds a sing
> through django forms, and now that song is added to the user's personal
> library.
> now what I want to do is :
>
>
> *When the lyrics of a song are added as a record to the "Song" table, the
> individual words in that song should be added to a 2nd table with their
> frequency of usage within that song (so the words need to be counted and a
> signal needs to be created).Also, when a user adds the song to his/her
> personal library, all of the words from the song and their frequencies
> within that song should be added to another table and associated with that
> user.*
>
> how to count same word within a song?
>
> can anyone help me here?
> your help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPEfQMQcJ0Na%2BxR4AE0QeuJ5RL4VucmaDpJ84_fg9YKUDqqHAw%40mail.gmail.com.


Re: counting the same words within a song added by a user using Django

2021-07-11 Thread DJANGO DEVELOPER
Sum thanks for your interest.
these are the screenshots of my requirements and of models.

On Mon, Jul 12, 2021 at 2:44 AM sum abiut  wrote:

> I might not fully understand your question. Can you show me what you have
> done? show us your models and what you want to achieve.
>
>
>
> On Fri, Jul 9, 2021 at 4:57 PM DJANGO DEVELOPER 
> wrote:
>
>> sum it is giving me error of TextField is not iterable
>>
>> On Wed, Jul 7, 2021 at 5:30 AM DJANGO DEVELOPER 
>> wrote:
>>
>>> so will it run smoothly?
>>> I mean there is no filter function there so will it filter a specific
>>> field and will give me count for the words?
>>>
>>> On Tue, Jul 6, 2021 at 9:40 PM sum abiut  wrote:
>>>
 You can to something like this

 def count_songs(request):
 #get the field that you want to count the words in it
 field_name = model._meta.get_field('your_field)

 word_count =Counter(field_name)

 for key, value in word_count.items():

   key = key

   value=value

 context={

 'key':key,

 'value':value,
 }

 return render(request, 'template.html', context)



 On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
 wrote:

> cool :D
>
> On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com
> wrote:
>
>> I found this as well. and I think  I want the result this way.
>>
>> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar 
>> wrote:
>>
>>> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
>>> Counter works with words also
>>>
>>> nice one Simon Charette learned something new :)
>>>
>>> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
>>> wrote:
>>>
 thanks Simon but I am not using postgresql. I am using sqlite3
 database. so I want a global solution, that work in all the databases.

 On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
 wrote:

> If you're using a PostgreSQL you might want to look at using a 
> tsvector
> column instead which will ignore stop words (the, or, of, ...) and map
> lexemes to their number of occurrence and position in the
> lyrics[0]. Assuming you were to index this column you'd be able to
> efficiently query it for existence of a particular lexeme or multiple 
> of
> them.
>
> You could then a union of all a user's song lyrics tsvector and
> even apply weights based on their listening frequency or their 
> favorite
> songs.
>
> Cheers,
> Simon
>
> [0]
> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
> écrit :
>
>> Thank you Lalit bhai.
>> it seems to be a solution.
>> but what if I want to get the result for each single word rather
>> than single letter?
>>
>>
>> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
>> wrote:
>>
>>> https://www.guru99.com/python-counter-collections-example.html
>>> Counter can be helpful for this situation
>>>
>>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER <
>>> abubak...@gmail.com> wrote:
>>>
 Hi there.
 I am developing a project based on adding songs to the user's
 library and to the home page.
 other users can also purchase the songs like wise people do
 shopping on eCommerce stores.
 *Problem:(Question)*
 The problem that I want to discuss here is that when a user
 adds a sing through django forms, and now that song is added to 
 the user's
 personal library.
 now what I want to do is :


 *When the lyrics of a song are added as a record to the "Song"
 table, the individual words in that song should be added to a 2nd 
 table
 with their frequency of usage within that song (so the words need 
 to be
 counted and a signal needs to be created).Also, when a user adds 
 the song
 to his/her personal library, all of the words from the song and 
 their
 frequencies within that song should be added to another table and
 associated with that user.*

 how to count same word within a song?

 can anyone help me here?
 your help would be appreciated.

 --
 You received this message because you are subscribed to the
 Google Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from
 it, send an email to

Re: counting the same words within a song added by a user using Django

2021-07-11 Thread sum abiut
I might not fully understand your question. Can you show me what you have
done? show us your models and what you want to achieve.



On Fri, Jul 9, 2021 at 4:57 PM DJANGO DEVELOPER 
wrote:

> sum it is giving me error of TextField is not iterable
>
> On Wed, Jul 7, 2021 at 5:30 AM DJANGO DEVELOPER 
> wrote:
>
>> so will it run smoothly?
>> I mean there is no filter function there so will it filter a specific
>> field and will give me count for the words?
>>
>> On Tue, Jul 6, 2021 at 9:40 PM sum abiut  wrote:
>>
>>> You can to something like this
>>>
>>> def count_songs(request):
>>> #get the field that you want to count the words in it
>>> field_name = model._meta.get_field('your_field)
>>>
>>> word_count =Counter(field_name)
>>>
>>> for key, value in word_count.items():
>>>
>>>   key = key
>>>
>>>   value=value
>>>
>>> context={
>>>
>>> 'key':key,
>>>
>>> 'value':value,
>>> }
>>>
>>> return render(request, 'template.html', context)
>>>
>>>
>>>
>>> On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
>>> wrote:
>>>
 cool :D

 On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:

> I found this as well. and I think  I want the result this way.
>
> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar 
> wrote:
>
>> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
>> Counter works with words also
>>
>> nice one Simon Charette learned something new :)
>>
>> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
>> wrote:
>>
>>> thanks Simon but I am not using postgresql. I am using sqlite3
>>> database. so I want a global solution, that work in all the databases.
>>>
>>> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
>>> wrote:
>>>
 If you're using a PostgreSQL you might want to look at using a tsvector
 column instead which will ignore stop words (the, or, of, ...) and map
 lexemes to their number of occurrence and position in the
 lyrics[0]. Assuming you were to index this column you'd be able to
 efficiently query it for existence of a particular lexeme or multiple 
 of
 them.

 You could then a union of all a user's song lyrics tsvector and
 even apply weights based on their listening frequency or their favorite
 songs.

 Cheers,
 Simon

 [0]
 https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
 Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
 écrit :

> Thank you Lalit bhai.
> it seems to be a solution.
> but what if I want to get the result for each single word rather
> than single letter?
>
>
> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
> wrote:
>
>> https://www.guru99.com/python-counter-collections-example.html
>> Counter can be helpful for this situation
>>
>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER <
>> abubak...@gmail.com> wrote:
>>
>>> Hi there.
>>> I am developing a project based on adding songs to the user's
>>> library and to the home page.
>>> other users can also purchase the songs like wise people do
>>> shopping on eCommerce stores.
>>> *Problem:(Question)*
>>> The problem that I want to discuss here is that when a user adds
>>> a sing through django forms, and now that song is added to the 
>>> user's
>>> personal library.
>>> now what I want to do is :
>>>
>>>
>>> *When the lyrics of a song are added as a record to the "Song"
>>> table, the individual words in that song should be added to a 2nd 
>>> table
>>> with their frequency of usage within that song (so the words need 
>>> to be
>>> counted and a signal needs to be created).Also, when a user adds 
>>> the song
>>> to his/her personal library, all of the words from the song and 
>>> their
>>> frequencies within that song should be added to another table and
>>> associated with that user.*
>>>
>>> how to count same word within a song?
>>>
>>> can anyone help me here?
>>> your help would be appreciated.
>>>
>>> --
>>> You received this message because you are subscribed to the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from
>>> it, send an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>>> 

Re: counting the same words within a song added by a user using Django

2021-07-09 Thread DJANGO DEVELOPER
https://stackoverflow.com/questions/41689274/split-multiple-selections-into-separate-records-in-a-django-model

I also want the same result as it is mentioned here in the stackoverflow
question

On Fri, Jul 9, 2021 at 10:56 AM DJANGO DEVELOPER 
wrote:

> sum it is giving me error of TextField is not iterable
>
> On Wed, Jul 7, 2021 at 5:30 AM DJANGO DEVELOPER 
> wrote:
>
>> so will it run smoothly?
>> I mean there is no filter function there so will it filter a specific
>> field and will give me count for the words?
>>
>> On Tue, Jul 6, 2021 at 9:40 PM sum abiut  wrote:
>>
>>> You can to something like this
>>>
>>> def count_songs(request):
>>> #get the field that you want to count the words in it
>>> field_name = model._meta.get_field('your_field)
>>>
>>> word_count =Counter(field_name)
>>>
>>> for key, value in word_count.items():
>>>
>>>   key = key
>>>
>>>   value=value
>>>
>>> context={
>>>
>>> 'key':key,
>>>
>>> 'value':value,
>>> }
>>>
>>> return render(request, 'template.html', context)
>>>
>>>
>>>
>>> On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
>>> wrote:
>>>
 cool :D

 On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:

> I found this as well. and I think  I want the result this way.
>
> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar 
> wrote:
>
>> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
>> Counter works with words also
>>
>> nice one Simon Charette learned something new :)
>>
>> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
>> wrote:
>>
>>> thanks Simon but I am not using postgresql. I am using sqlite3
>>> database. so I want a global solution, that work in all the databases.
>>>
>>> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
>>> wrote:
>>>
 If you're using a PostgreSQL you might want to look at using a tsvector
 column instead which will ignore stop words (the, or, of, ...) and map
 lexemes to their number of occurrence and position in the
 lyrics[0]. Assuming you were to index this column you'd be able to
 efficiently query it for existence of a particular lexeme or multiple 
 of
 them.

 You could then a union of all a user's song lyrics tsvector and
 even apply weights based on their listening frequency or their favorite
 songs.

 Cheers,
 Simon

 [0]
 https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
 Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
 écrit :

> Thank you Lalit bhai.
> it seems to be a solution.
> but what if I want to get the result for each single word rather
> than single letter?
>
>
> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
> wrote:
>
>> https://www.guru99.com/python-counter-collections-example.html
>> Counter can be helpful for this situation
>>
>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER <
>> abubak...@gmail.com> wrote:
>>
>>> Hi there.
>>> I am developing a project based on adding songs to the user's
>>> library and to the home page.
>>> other users can also purchase the songs like wise people do
>>> shopping on eCommerce stores.
>>> *Problem:(Question)*
>>> The problem that I want to discuss here is that when a user adds
>>> a sing through django forms, and now that song is added to the 
>>> user's
>>> personal library.
>>> now what I want to do is :
>>>
>>>
>>> *When the lyrics of a song are added as a record to the "Song"
>>> table, the individual words in that song should be added to a 2nd 
>>> table
>>> with their frequency of usage within that song (so the words need 
>>> to be
>>> counted and a signal needs to be created).Also, when a user adds 
>>> the song
>>> to his/her personal library, all of the words from the song and 
>>> their
>>> frequencies within that song should be added to another table and
>>> associated with that user.*
>>>
>>> how to count same word within a song?
>>>
>>> can anyone help me here?
>>> your help would be appreciated.
>>>
>>> --
>>> You received this message because you are subscribed to the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from
>>> it, send an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>>> 

Re: counting the same words within a song added by a user using Django

2021-07-08 Thread DJANGO DEVELOPER
sum it is giving me error of TextField is not iterable

On Wed, Jul 7, 2021 at 5:30 AM DJANGO DEVELOPER 
wrote:

> so will it run smoothly?
> I mean there is no filter function there so will it filter a specific
> field and will give me count for the words?
>
> On Tue, Jul 6, 2021 at 9:40 PM sum abiut  wrote:
>
>> You can to something like this
>>
>> def count_songs(request):
>> #get the field that you want to count the words in it
>> field_name = model._meta.get_field('your_field)
>>
>> word_count =Counter(field_name)
>>
>> for key, value in word_count.items():
>>
>>   key = key
>>
>>   value=value
>>
>> context={
>>
>> 'key':key,
>>
>> 'value':value,
>> }
>>
>> return render(request, 'template.html', context)
>>
>>
>>
>> On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
>> wrote:
>>
>>> cool :D
>>>
>>> On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:
>>>
 I found this as well. and I think  I want the result this way.

 On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar 
 wrote:

> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
> Counter works with words also
>
> nice one Simon Charette learned something new :)
>
> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
> wrote:
>
>> thanks Simon but I am not using postgresql. I am using sqlite3
>> database. so I want a global solution, that work in all the databases.
>>
>> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
>> wrote:
>>
>>> If you're using a PostgreSQL you might want to look at using a tsvector
>>> column instead which will ignore stop words (the, or, of, ...) and map
>>> lexemes to their number of occurrence and position in the
>>> lyrics[0]. Assuming you were to index this column you'd be able to
>>> efficiently query it for existence of a particular lexeme or multiple of
>>> them.
>>>
>>> You could then a union of all a user's song lyrics tsvector and even
>>> apply weights based on their listening frequency or their favorite 
>>> songs.
>>>
>>> Cheers,
>>> Simon
>>>
>>> [0]
>>> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
>>> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
>>> écrit :
>>>
 Thank you Lalit bhai.
 it seems to be a solution.
 but what if I want to get the result for each single word rather
 than single letter?


 On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
 wrote:

> https://www.guru99.com/python-counter-collections-example.html
> Counter can be helpful for this situation
>
> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
> wrote:
>
>> Hi there.
>> I am developing a project based on adding songs to the user's
>> library and to the home page.
>> other users can also purchase the songs like wise people do
>> shopping on eCommerce stores.
>> *Problem:(Question)*
>> The problem that I want to discuss here is that when a user adds
>> a sing through django forms, and now that song is added to the user's
>> personal library.
>> now what I want to do is :
>>
>>
>> *When the lyrics of a song are added as a record to the "Song"
>> table, the individual words in that song should be added to a 2nd 
>> table
>> with their frequency of usage within that song (so the words need to 
>> be
>> counted and a signal needs to be created).Also, when a user adds the 
>> song
>> to his/her personal library, all of the words from the song and their
>> frequencies within that song should be added to another table and
>> associated with that user.*
>>
>> how to count same word within a song?
>>
>> can anyone help me here?
>> your help would be appreciated.
>>
>> --
>> You received this message because you are subscribed to the
>> Google Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to django-users...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users...@googlegroups.com.
>
 To view this discussion on the

Re: counting the same words within a song added by a user using Django

2021-07-06 Thread DJANGO DEVELOPER
so will it run smoothly?
I mean there is no filter function there so will it filter a specific field
and will give me count for the words?

On Tue, Jul 6, 2021 at 9:40 PM sum abiut  wrote:

> You can to something like this
>
> def count_songs(request):
> #get the field that you want to count the words in it
> field_name = model._meta.get_field('your_field)
>
> word_count =Counter(field_name)
>
> for key, value in word_count.items():
>
>   key = key
>
>   value=value
>
> context={
>
> 'key':key,
>
> 'value':value,
> }
>
> return render(request, 'template.html', context)
>
>
>
> On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
> wrote:
>
>> cool :D
>>
>> On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:
>>
>>> I found this as well. and I think  I want the result this way.
>>>
>>> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar 
>>> wrote:
>>>
 [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
 Counter works with words also

 nice one Simon Charette learned something new :)

 On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
 wrote:

> thanks Simon but I am not using postgresql. I am using sqlite3
> database. so I want a global solution, that work in all the databases.
>
> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
> wrote:
>
>> If you're using a PostgreSQL you might want to look at using a tsvector
>> column instead which will ignore stop words (the, or, of, ...) and map
>> lexemes to their number of occurrence and position in the lyrics[0].
>> Assuming you were to index this column you'd be able to efficiently query
>> it for existence of a particular lexeme or multiple of them.
>>
>> You could then a union of all a user's song lyrics tsvector and even
>> apply weights based on their listening frequency or their favorite songs.
>>
>> Cheers,
>> Simon
>>
>> [0]
>> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
>> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
>> écrit :
>>
>>> Thank you Lalit bhai.
>>> it seems to be a solution.
>>> but what if I want to get the result for each single word rather
>>> than single letter?
>>>
>>>
>>> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
>>> wrote:
>>>
 https://www.guru99.com/python-counter-collections-example.html
 Counter can be helpful for this situation

 On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
 wrote:

> Hi there.
> I am developing a project based on adding songs to the user's
> library and to the home page.
> other users can also purchase the songs like wise people do
> shopping on eCommerce stores.
> *Problem:(Question)*
> The problem that I want to discuss here is that when a user adds a
> sing through django forms, and now that song is added to the user's
> personal library.
> now what I want to do is :
>
>
> *When the lyrics of a song are added as a record to the "Song"
> table, the individual words in that song should be added to a 2nd 
> table
> with their frequency of usage within that song (so the words need to 
> be
> counted and a signal needs to be created).Also, when a user adds the 
> song
> to his/her personal library, all of the words from the song and their
> frequencies within that song should be added to another table and
> associated with that user.*
>
> how to count same word within a song?
>
> can anyone help me here?
> your help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to django-users...@googlegroups.com.

>>> To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
 

Re: counting the same words within a song added by a user using Django

2021-07-06 Thread sum abiut
You can to something like this

def count_songs(request):
#get the field that you want to count the words in it
field_name = model._meta.get_field('your_field)

word_count =Counter(field_name)

for key, value in word_count.items():

  key = key

  value=value

context={

'key':key,

'value':value,
}

return render(request, 'template.html', context)



On Tue, Jul 6, 2021 at 7:09 PM lalit suthar 
wrote:

> cool :D
>
> On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:
>
>> I found this as well. and I think  I want the result this way.
>>
>> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar  wrote:
>>
>>> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
>>> Counter works with words also
>>>
>>> nice one Simon Charette learned something new :)
>>>
>>> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
>>> wrote:
>>>
 thanks Simon but I am not using postgresql. I am using sqlite3
 database. so I want a global solution, that work in all the databases.

 On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
 wrote:

> If you're using a PostgreSQL you might want to look at using a tsvector
> column instead which will ignore stop words (the, or, of, ...) and map
> lexemes to their number of occurrence and position in the lyrics[0].
> Assuming you were to index this column you'd be able to efficiently query
> it for existence of a particular lexeme or multiple of them.
>
> You could then a union of all a user's song lyrics tsvector and even
> apply weights based on their listening frequency or their favorite songs.
>
> Cheers,
> Simon
>
> [0]
> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a
> écrit :
>
>> Thank you Lalit bhai.
>> it seems to be a solution.
>> but what if I want to get the result for each single word rather than
>> single letter?
>>
>>
>> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
>> wrote:
>>
>>> https://www.guru99.com/python-counter-collections-example.html
>>> Counter can be helpful for this situation
>>>
>>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
>>> wrote:
>>>
 Hi there.
 I am developing a project based on adding songs to the user's
 library and to the home page.
 other users can also purchase the songs like wise people do
 shopping on eCommerce stores.
 *Problem:(Question)*
 The problem that I want to discuss here is that when a user adds a
 sing through django forms, and now that song is added to the user's
 personal library.
 now what I want to do is :


 *When the lyrics of a song are added as a record to the "Song"
 table, the individual words in that song should be added to a 2nd table
 with their frequency of usage within that song (so the words need to be
 counted and a signal needs to be created).Also, when a user adds the 
 song
 to his/her personal library, all of the words from the song and their
 frequencies within that song should be added to another table and
 associated with that user.*

 how to count same word within a song?

 can anyone help me here?
 your help would be appreciated.

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it,
 send an email to django-users...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com.
> To view this discussion on the web visit

Re: counting the same words within a song added by a user using Django

2021-07-06 Thread lalit suthar
cool :D 

On Tuesday, 6 July 2021 at 10:25:06 UTC+5:30 abubak...@gmail.com wrote:

> I found this as well. and I think  I want the result this way.
>
> On Tue, Jul 6, 2021 at 9:21 AM Lalit Suthar  wrote:
>
>> [image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
>> Counter works with words also
>>
>> nice one Simon Charette learned something new :) 
>>
>> On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER  
>> wrote:
>>
>>> thanks Simon but I am not using postgresql. I am using sqlite3 database. 
>>> so I want a global solution, that work in all the databases.
>>>
>>> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette  
>>> wrote:
>>>
 If you're using a PostgreSQL you might want to look at using a tsvector 
 column instead which will ignore stop words (the, or, of, ...) and map 
 lexemes to their number of occurrence and position in the lyrics[0]. 
 Assuming you were to index this column you'd be able to efficiently query 
 it for existence of a particular lexeme or multiple of them.

 You could then a union of all a user's song lyrics tsvector and even 
 apply weights based on their listening frequency or their favorite songs.

 Cheers,
 Simon

 [0] 
 https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
 Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a écrit :

> Thank you Lalit bhai.
> it seems to be a solution.
> but what if I want to get the result for each single word rather than 
> single letter?
>
>
> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar  
> wrote:
>
>> https://www.guru99.com/python-counter-collections-example.html
>> Counter can be helpful for this situation
>>
>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER  
>> wrote:
>>
>>> Hi there.
>>> I am developing a project based on adding songs to the user's 
>>> library and to the home page.
>>> other users can also purchase the songs like wise people do shopping 
>>> on eCommerce stores.
>>> *Problem:(Question)*
>>> The problem that I want to discuss here is that when a user adds a 
>>> sing through django forms, and now that song is added to the user's 
>>> personal library.
>>> now what I want to do is :
>>>
>>>
>>> *When the lyrics of a song are added as a record to the "Song" 
>>> table, the individual words in that song should be added to a 2nd table 
>>> with their frequency of usage within that song (so the words need to be 
>>> counted and a signal needs to be created).Also, when a user adds the 
>>> song 
>>> to his/her personal library, all of the words from the song and their 
>>> frequencies within that song should be added to another table and 
>>> associated with that user.*
>>>
>>> how to count same word within a song? 
>>>
>>> can anyone help me here?
>>> your help would be appreciated.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, 
>>> send an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
>>  
>> 
>> .
>>
> -- 
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/django-users/c77799f3-1492-459a-8187-8d62985407b6n%40googlegroups.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email t

Re: counting the same words within a song added by a user using Django

2021-07-05 Thread Lalit Suthar
[image: Screen Shot 2021-07-06 at 9.50.12 AM.png]
Counter works with words also

nice one Simon Charette learned something new :)

On Tue, 6 Jul 2021 at 07:56, DJANGO DEVELOPER 
wrote:

> thanks Simon but I am not using postgresql. I am using sqlite3 database.
> so I want a global solution, that work in all the databases.
>
> On Tue, Jul 6, 2021 at 1:54 AM Simon Charette 
> wrote:
>
>> If you're using a PostgreSQL you might want to look at using a tsvector
>> column instead which will ignore stop words (the, or, of, ...) and map
>> lexemes to their number of occurrence and position in the lyrics[0].
>> Assuming you were to index this column you'd be able to efficiently query
>> it for existence of a particular lexeme or multiple of them.
>>
>> You could then a union of all a user's song lyrics tsvector and even
>> apply weights based on their listening frequency or their favorite songs.
>>
>> Cheers,
>> Simon
>>
>> [0]
>> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
>> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a écrit :
>>
>>> Thank you Lalit bhai.
>>> it seems to be a solution.
>>> but what if I want to get the result for each single word rather than
>>> single letter?
>>>
>>>
>>> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
>>> wrote:
>>>
 https://www.guru99.com/python-counter-collections-example.html
 Counter can be helpful for this situation

 On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
 wrote:

> Hi there.
> I am developing a project based on adding songs to the user's library
> and to the home page.
> other users can also purchase the songs like wise people do shopping
> on eCommerce stores.
> *Problem:(Question)*
> The problem that I want to discuss here is that when a user adds a
> sing through django forms, and now that song is added to the user's
> personal library.
> now what I want to do is :
>
>
> *When the lyrics of a song are added as a record to the "Song" table,
> the individual words in that song should be added to a 2nd table with 
> their
> frequency of usage within that song (so the words need to be counted and a
> signal needs to be created).Also, when a user adds the song to his/her
> personal library, all of the words from the song and their frequencies
> within that song should be added to another table and associated with that
> user.*
>
> how to count same word within a song?
>
> can anyone help me here?
> your help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users...@googlegroups.com.

>>> To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
 
 .

>>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/c77799f3-1492-459a-8187-8d62985407b6n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKPY9pnp0GG%2BwUHf68gfbMXUMV9BiY7qsR%3D_Dw1yrmsEkK6SdA%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To u

Re: counting the same words within a song added by a user using Django

2021-07-05 Thread DJANGO DEVELOPER
thanks Simon but I am not using postgresql. I am using sqlite3 database. so
I want a global solution, that work in all the databases.

On Tue, Jul 6, 2021 at 1:54 AM Simon Charette  wrote:

> If you're using a PostgreSQL you might want to look at using a tsvector
> column instead which will ignore stop words (the, or, of, ...) and map
> lexemes to their number of occurrence and position in the lyrics[0].
> Assuming you were to index this column you'd be able to efficiently query
> it for existence of a particular lexeme or multiple of them.
>
> You could then a union of all a user's song lyrics tsvector and even apply
> weights based on their listening frequency or their favorite songs.
>
> Cheers,
> Simon
>
> [0]
> https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
> Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a écrit :
>
>> Thank you Lalit bhai.
>> it seems to be a solution.
>> but what if I want to get the result for each single word rather than
>> single letter?
>>
>>
>> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar  wrote:
>>
>>> https://www.guru99.com/python-counter-collections-example.html
>>> Counter can be helpful for this situation
>>>
>>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
>>> wrote:
>>>
 Hi there.
 I am developing a project based on adding songs to the user's library
 and to the home page.
 other users can also purchase the songs like wise people do shopping on
 eCommerce stores.
 *Problem:(Question)*
 The problem that I want to discuss here is that when a user adds a sing
 through django forms, and now that song is added to the user's personal
 library.
 now what I want to do is :


 *When the lyrics of a song are added as a record to the "Song" table,
 the individual words in that song should be added to a 2nd table with their
 frequency of usage within that song (so the words need to be counted and a
 signal needs to be created).Also, when a user adds the song to his/her
 personal library, all of the words from the song and their frequencies
 within that song should be added to another table and associated with that
 user.*

 how to count same word within a song?

 can anyone help me here?
 your help would be appreciated.

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c77799f3-1492-459a-8187-8d62985407b6n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKPY9pnp0GG%2BwUHf68gfbMXUMV9BiY7qsR%3D_Dw1yrmsEkK6SdA%40mail.gmail.com.


Re: counting the same words within a song added by a user using Django

2021-07-05 Thread Simon Charette
If you're using a PostgreSQL you might want to look at using a tsvector 
column instead which will ignore stop words (the, or, of, ...) and map 
lexemes to their number of occurrence and position in the lyrics[0]. 
Assuming you were to index this column you'd be able to efficiently query 
it for existence of a particular lexeme or multiple of them.

You could then a union of all a user's song lyrics tsvector and even apply 
weights based on their listening frequency or their favorite songs.

Cheers,
Simon

[0] 
https://stackoverflow.com/questions/25445670/retrieving-position-and-number-of-lexem-occurrences-from-tsvector
Le lundi 5 juillet 2021 à 13:51:48 UTC-4, abubak...@gmail.com a écrit :

> Thank you Lalit bhai.
> it seems to be a solution.
> but what if I want to get the result for each single word rather than 
> single letter?
>
>
> On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar  wrote:
>
>> https://www.guru99.com/python-counter-collections-example.html
>> Counter can be helpful for this situation
>>
>> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER  
>> wrote:
>>
>>> Hi there.
>>> I am developing a project based on adding songs to the user's library 
>>> and to the home page.
>>> other users can also purchase the songs like wise people do shopping on 
>>> eCommerce stores.
>>> *Problem:(Question)*
>>> The problem that I want to discuss here is that when a user adds a sing 
>>> through django forms, and now that song is added to the user's personal 
>>> library.
>>> now what I want to do is :
>>>
>>>
>>> *When the lyrics of a song are added as a record to the "Song" table, 
>>> the individual words in that song should be added to a 2nd table with their 
>>> frequency of usage within that song (so the words need to be counted and a 
>>> signal needs to be created).Also, when a user adds the song to his/her 
>>> personal library, all of the words from the song and their frequencies 
>>> within that song should be added to another table and associated with that 
>>> user.*
>>>
>>> how to count same word within a song? 
>>>
>>> can anyone help me here?
>>> your help would be appreciated.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c77799f3-1492-459a-8187-8d62985407b6n%40googlegroups.com.


Re: counting the same words within a song added by a user using Django

2021-07-05 Thread DJANGO DEVELOPER
Thank you Lalit bhai.
it seems to be a solution.
but what if I want to get the result for each single word rather than
single letter?


On Mon, Jul 5, 2021 at 5:43 PM Lalit Suthar 
wrote:

> https://www.guru99.com/python-counter-collections-example.html
> Counter can be helpful for this situation
>
> On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
> wrote:
>
>> Hi there.
>> I am developing a project based on adding songs to the user's library and
>> to the home page.
>> other users can also purchase the songs like wise people do shopping on
>> eCommerce stores.
>> *Problem:(Question)*
>> The problem that I want to discuss here is that when a user adds a sing
>> through django forms, and now that song is added to the user's personal
>> library.
>> now what I want to do is :
>>
>>
>> *When the lyrics of a song are added as a record to the "Song" table, the
>> individual words in that song should be added to a 2nd table with their
>> frequency of usage within that song (so the words need to be counted and a
>> signal needs to be created).Also, when a user adds the song to his/her
>> personal library, all of the words from the song and their frequencies
>> within that song should be added to another table and associated with that
>> user.*
>>
>> how to count same word within a song?
>>
>> can anyone help me here?
>> your help would be appreciated.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKPY9p%3Dyw_AE71kRi5JMmi8Vsj3J07RUhWCpS2i6UPaDUr4jCQ%40mail.gmail.com.


Re: counting the same words within a song added by a user using Django

2021-07-05 Thread Lalit Suthar
https://www.guru99.com/python-counter-collections-example.html
Counter can be helpful for this situation

On Mon, 5 Jul 2021 at 17:07, DJANGO DEVELOPER 
wrote:

> Hi there.
> I am developing a project based on adding songs to the user's library and
> to the home page.
> other users can also purchase the songs like wise people do shopping on
> eCommerce stores.
> *Problem:(Question)*
> The problem that I want to discuss here is that when a user adds a sing
> through django forms, and now that song is added to the user's personal
> library.
> now what I want to do is :
>
>
> *When the lyrics of a song are added as a record to the "Song" table, the
> individual words in that song should be added to a 2nd table with their
> frequency of usage within that song (so the words need to be counted and a
> signal needs to be created).Also, when a user adds the song to his/her
> personal library, all of the words from the song and their frequencies
> within that song should be added to another table and associated with that
> user.*
>
> how to count same word within a song?
>
> can anyone help me here?
> your help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGp2JVHuos6d4%3D-_S%3DR-q8hq48Yzf%3D-xgmPziKEA2a3DYXAzbg%40mail.gmail.com.


counting the same words within a song added by a user using Django

2021-07-05 Thread DJANGO DEVELOPER
Hi there.
I am developing a project based on adding songs to the user's library and 
to the home page.
other users can also purchase the songs like wise people do shopping on 
eCommerce stores.
*Problem:(Question)*
The problem that I want to discuss here is that when a user adds a sing 
through django forms, and now that song is added to the user's personal 
library.
now what I want to do is :


*When the lyrics of a song are added as a record to the "Song" table, the 
individual words in that song should be added to a 2nd table with their 
frequency of usage within that song (so the words need to be counted and a 
signal needs to be created).Also, when a user adds the song to his/her 
personal library, all of the words from the song and their frequencies 
within that song should be added to another table and associated with that 
user.*

how to count same word within a song? 

can anyone help me here?
your help would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bc7bc37b-6f26-465c-b330-d275ab86b76an%40googlegroups.com.