I want to import these positive words and negative words, it's too bothering to add them one by one.

Comments

fishfree created an issue. See original summary.

polaki_viswanath’s picture

Hi

Sure I will try to implement it in the module. Meanwhile if you want you can do it via database query.

Do you have database access?

If yes, then I can give you query to update the table with new words in one go.

fishfree’s picture

I have database access. Could you please share your SQL? Even one has no database access, he can still use the Devel module to execute db_query(); function.

polaki_viswanath’s picture

Hi
Here is the sql to insert multiple words along with weight in one go.

Just replace the values of your desired words and weights.

This is a query to insert three words at once, you can insert as many as you can by following the format below.

INSERT INTO `word_with_weight` (`name`, `weight`, `uid`) VALUES ('first_word', '2', 1), ('second_word', '2', 1), ('third_word', '-2', 1)

Note: All the value sets e.g ('first_word', '2', 1) must be seprated with comma " , " and don't put comma " , " after the last value set.

For single word use query: INSERT INTO `word_with_weight` (`name`, `weight`, `uid`) VALUES ('first_word', '2', 1)

Thanks

Please let me know if are having any issues / queries.

fishfree’s picture

Thank you, I imported those positive and negative words now. But when I create an article and click on the save button, the page shows: Warning: preg_match_all(): Compilation failed: nothing to repeat at offset 7 in cmood_calculate() (line 263 of /var/www/html/sites/all/modules/contrib/cmood/cmood.module).
I have set CMOOD to calculate moods of article content type.

polaki_viswanath’s picture

Hi

Can you send me the article contents ( title and body) values. And also send me the list of mood words and rank words used in the article contents.

And have you checked if all the mood words got imported correctly. Check by clicking edit link of any one.

I have checked again, the words are imported correctly, may be there is some edge case with calculation or mood.

fishfree’s picture

Sorry for my late reply.
Title: How to build a Raspberry Pi home dashboard
Body:
I was lucky enough to get an accessible Raspberry Pi 2B with a 7-inch display for Christmas last year. I immediately had a plan for how to us it: I would make a home dashboard to show some useful information that is readable from around the living room.

More on Raspberry Pi
Our latest on Raspberry Pi
What is Raspberry Pi?
Getting started with Raspberry Pi
Send us your Raspberry Pi projects and tutorials
Current temperature and weather forecast in my area
Next buses due at the local bus stops
The news headlines
The Tube status
My fuzzed location (e.g., at work, traveling)
How to get started

I decided to write the dashboard in Python 3 and use the flask framework because I wanted to build up my Python 3 skills. I also wanted to be able to play with NFC (Near Field Communication) tags and see what they could do.

The concept behind the use of NFC tags is that it allows you to place tags in various locations, touch your phone on them, and use the NFC reader app update my dashboard at home. You need a phone that has NFC enabled (my Nexus 4 does).

I added a mood word "accessible" with weight 5, and a rank word "very" with weight 2. But on the node view page, nothing related to mood shows up.

polaki_viswanath’s picture

Hi Fishfree

Greetings of the day.

I have checked your content. There is nothing wrong in calculating the mood of the node. You just need to login via administrator and go to URL: {your-domain}/admin/cmood

Here you can see the mood of the node which you have created.
I have added your mood and rank words and then added the node, It shows me it has a mood of 5.

If you want to display this value on node view then you have to do some coding. As this module can only calculate mood for you but showing the mood on node view is not done in the module. This module provides views integration, hope you can create a view with the node and display the mood on your view page.

If you have any queries / feedback, please let me know.

fishfree’s picture

I got it. Thank you for your tip!

polaki_viswanath’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.