I have some text files or html file. I want to retrieve some words from the text. My worry is that I have to do text-mining on mobile. Which algorithm can I use for text-mining on a mobile. A sample example would be appreciated.
I dont think that you need to do text mining on mobile, because the algorithms are mostly trained on servers on the cloud. Besides that, if you have a lot of files, you can overload the cellphone CPU.
If you have a few files, why don't you use regex?
Its difficult to give an example because you gave too little information about the case.
I think that you need to Google better this before, and return with a more especific question.
Related
I am making a framework in order to easily "appify" books.
This framework will need to automatically detect chapter and heading to make a table of contents. The idea is to also be able to easily search through the text and find what you are looking for.
Now what I still need to figure out is:
how to store the data in such a way that I can easily detect the chapters and heading
and still be able to search through the text.
The text that is stored needs to be formatted, so I thought I would store them as HTML or Markdown (which will be translated to HTML). I don't think it would be very searchable if the text is in HTML.
P.S. it does not have to be HTML if there are other more efficient ways to format the text.
Do you really want to do such thing on the device itself?
I can suggest you to use separate sqlite database for every book. With separate tables for table of contents, chapters, summarized keywords of chapters(for faster search) and other service info.
Also here you can find full text search example
Also I recommend you to bring your own sqlite build with your app.
Now lets talk about the main problem of yours - the book scraping.
I have no competency here, I believe this problem is the same as the web sites scraping.
Upd:
Please do not store book contents as HTML, you can store it as markdown for example, it takes less amount of storage, easier to sanitize and you can always apply your styles later
I'm developing an android app in which we're going to display some mathematics and physics question with multiple-choice answers.
The text of the questions are ready on a Microsoft Office Word .docx format.
The text of the questions usually contains formulas and equations and we want to save them in a SQLite database and access to it on android app.
The real problem is how to manage the displaying part, since to the best of my knowledge, we should manage such complex text with html tags.
There are actually about at least 2000 of these questions and we're after an optimized solutions for the problem.
and I'm a tough guy ! :) just give me some keywords and I'll go get it done.
So, please share your experiences and suggestions.
An easy solution, mentioned in the comments, would be to use MathJAX.
An alternative, if you only have about 2000 formulas, would be to set up TeX on your local machine, generate the formulas, and convert into individual png images.
You could also use HTML+Unicode directly if the formulas are simple.
I m working on app which uses sqlite database . I got sucess to store Strings in various languages and also fetching from database .
But My problem is that i want to store it in bold or italic style.
Is it possible ?? If yes then how can i achieve that kind of thing ?
Any help will be appreciated.
Format the strings using html.
When you want to display them use Html.fromhtml( your string)
E.g.
String myboldstring = <b>boldy</b>
textView.setText(Html.fromhtml(myboldstring));
Is it what you want?
As an alternative to LazyN's solution I suggest you look at using a standard markdown language for this kind of context (much as stack overflow does). There are several advantages:
Widely used around the web so your users are likely to understand how to use it.
Much more secure in the sense that one cannot inject malicious HTML/javascript; this is very difficult to prevent once you allow any HTML as LazyN suggests
Trivial to store/export/import etc as it is all legal text string
this is my first app and I am trying to help out a business that I work for. Basically I picked up Android Tablet Application for Dummies and have been using it as reference. I am making a sort of time card application for a business I work for. My goal is that I want to take the information that the workers would enter in over the course of the day, and have them email it to the person writing payroll. Is there any way for me to just email the database with all of the contents? Or a simple way to send the contents in another easy to read format? Open to all suggestions and alternatives, thank you for your time!
A raw db file probably is not going to be terribly useful for the payroll person.
If I were you I'd make something that will query your DB for all rows, once you have the resulting cursor you can iterate over it and put the data into some more useful data format.
The data format you choose depends on your situation. XML or CSV seem like good options. CSV perhaps a little bit better since it would be able to be opened in Excel (which anyone in payroll probably has access to)
You could also make your own data format if you want. Some sort of plain txt flatfile would be easiest, and it would be very human readable (Easier for payroll employee)
something like this:
IN Mike 2:31pm 6/14
IN Joe 2:45pm 6/14
OUT Mike 4:55pm 6/14
etc...
Then if you were nice you'd make something to go at the end that will tally up total hours for the day and/or pay period
Total Hours for period
Mike: 25.4
Joe: 22.3
etc...
EDIT: There are many examples of CSV all around the web.
Start Here to learn what it is.
Once you understand what it is you'll need to learn how to implement the read/write in java. You can do it with plain java using strings fairly easy. But there are also some Libraries out that that make it a whole lot easier for you to interact with CSV data.
I want to store structure type data (i.e. information of call logs like name, number, type of number, date, time, duration). Which is the best way and which is faster? SQLiteDatabase (make table and insert, delete logs in it) or use file storage (means make one class for all parameters and write their objects in file using input/output Stream and serializable) or the another way i heard about it is XML parser but i don't know this.
Please help me. Thanks in advance.
It depends on what you are trying to do.
If your goal is speed, the SQLite will give you a serious run for your money (especially if you wrap multiple inserts into transactions). SQLite has been optimized for everything you mentioned and it would be very easy to leverage the speed it can give you.
If portability is your goal, then files may be a slight bit easier. Files can be moved back and forth very easily easily, whereas SQLite might take some more effort.
If being able to search is your goal, then you'd be a fool not to use SQLite, as it is extremely good at searching and filtering results.
I can't give a very informed answer here because I'm just as new to the subject as you are, but here is the link from the developers page that goes over the different types of data storage. I hope you find it useful. http://developer.android.com/guide/topics/data/data-storage.html
Personally, given you know the basics of Databases I would use a sqlite database. It's pretty straight forward in Android. In terms of speed I don't know which is faster, but if you don't have millions of datasets it won't matter.
In my experience in most cases JSON in a file is enough (mostly you need to store an array or an object or just a single number or string). I rarely need SQLite (which needs more time for setting it up and using it).