I have code that allows me to get data from a Twitter Search API. However I am having trouble counting the emoticons. I have a text file, with 126 emoticons, that I have classified against numbers 1-6. These numbers represent emotions. So one column is emoticons and next to it is the corresponding number.
How do I read the text file that has both emoticon and number, and search the API and count the emoticons that it catches.
So for example
etc. That is how the text file is set up.
So every time an emoticon is caught in the search API, I want the count for each number to increase. How do I go about doing that? I have looked all over the web, which is how I noticed this forum.
I have tried that, but I have to input a pattern. And it gives me a count, but not one that is correct, because I checked manually.
Why are you using the + operator with chars? Do you realise that chars are not letters, but numbers? So your + will not give you the String at all? You can still use ==, but it will not give you the result you want.
I think you need to go back to a piece of paper and write down exactly how you intend to identify those emoticons. You cannot do it on screen, only on paper. then come back and tell us how you got on
Joined: Mar 13, 2013
Ok since you pointed that out about the char. I decided to put the emoticons into a Switch statement that deals with Strings.
How do i go through statements and access the Twitter API, and count the emoticons this way?? Please help..
How do I count the emoticons, when it passes through all those cases?
I have also thought of doing an array
But i have no idea, how to carry on. How do i query the array so that it goes through the Twitter api and gives me a count if it catches any of the elements?
Joined: Oct 13, 2005
That is not a switch which uses Strings, but a switch which uses ints. It will of course always print null.
There is some poor design there, a class with no methods and no constructor. It might compile, but it is of no use to anybody.
What do you mean by, “// I am unsure, why i need this bit”?
Joined: Mar 13, 2013
Hey, I managed to solve my problem.
You can close this thread.
subject: Need help to count emoticons from a Twitter search API?