Search Results

Search found 8167 results on 327 pages for 'general tapioca'.

Page 120/327 | < Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >

  • Need Help Customizing a Grammar Checking Replace Rule in Java

    - by user567785
    Hello, I am currently adding the Khmer (Cambodian) language to LanguageTool, an opensource grammar checker for OpenOffice (http://www.languagetool.org). I don't know enough Java to customize one of the scripts and wanted to make a request here asking if anyone would be willing to customize it for me (I can put link to your website at http://www.sbbic.org/lang/en-us/volunteer/ if you help). Here is the script that needs customization KhmerWordCoherencyRule.java: /* LanguageTool, a natural language style checker * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA */ package de.danielnaber.languagetool.rules.km; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import de.danielnaber.languagetool.AnalyzedSentence; import de.danielnaber.languagetool.AnalyzedToken; import de.danielnaber.languagetool.AnalyzedTokenReadings; import de.danielnaber.languagetool.JLanguageTool; import de.danielnaber.languagetool.tools.StringTools; import de.danielnaber.languagetool.rules.Category; import de.danielnaber.languagetool.rules.RuleMatch; /** * A Khmer rule that matches words or phrases which should not be used and suggests * correct ones instead. Loads the relevant words from * <code>rules/km/coherency.txt</code>, where km is a code of the language. * * @author Andriy Rysin */ public abstract class KhmerWordCoherencyRule extends KhmerRule { private static final String FILE_ENCODING = "utf-8"; private Map<String, String> wrongWords; // e.g. "????? -> "?????" private static final String FILE_NAME = "/km/coherency.txt"; public abstract String getFileName(); public String getEncoding() { return FILE_ENCODING; } /** * Indicates if the rule is case-sensitive. Default value is <code>true</code>. * @return true if the rule is case-sensitive, false otherwise. */ //in Khmer there is no case public boolean isCaseSensitive() { return false; } /** * @return the locale used for case conversion when {@link #isCaseSensitive()} is set to <code>false</code>. */ public Locale getLocale() { return Locale.getDefault(); } public KhmerWordCoherencyRule(final ResourceBundle messages) throws IOException { if (messages != null) { super.setCategory(new Category(messages.getString("category_misc"))); } wrongWords = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream(getFileName())); } public String getId() { return "KM_WORD_COHERENCY"; } public String getDescription() { return "Checks for wrong words/phrases"; } public String getSuggestion() { return " does not match your previous spelling of the word, use "; } public String getShort() { return "Use a consistant spelling throughout"; } public final RuleMatch[] match(final AnalyzedSentence text) { final List<RuleMatch> ruleMatches = new ArrayList<RuleMatch>(); final AnalyzedTokenReadings[] tokens = text.getTokensWithoutWhitespace(); for (int i = 1; i < tokens.length; i++) { final String token = tokens[i].getToken(); final String origToken = token; final String replacement = isCaseSensitive()?wrongWords.get(token):wrongWords.get(token.toLowerCase(getLocale())); if (replacement != null) { final String msg = token + getSuggestion() + replacement; final int pos = tokens[i].getStartPos(); final RuleMatch potentialRuleMatch = new RuleMatch(this, pos, pos + origToken.length(), msg, getShort()); if (!isCaseSensitive() && StringTools.startsWithUppercase(token)) { potentialRuleMatch.setSuggestedReplacement(StringTools.uppercaseFirstChar(replacement)); } else { potentialRuleMatch.setSuggestedReplacement(replacement); } ruleMatches.add(potentialRuleMatch); } } return toRuleMatchArray(ruleMatches); } private Map<String, String> loadWords(final InputStream file) throws IOException { final Map<String, String> map = new HashMap<String, String>(); InputStreamReader isr = null; BufferedReader br = null; try { isr = new InputStreamReader(file, getEncoding()); br = new BufferedReader(isr); String line; while ((line = br.readLine()) != null) { line = line.trim(); if (line.length() < 1) { continue; } if (line.charAt(0) == '#') { // ignore comments continue; } final String[] parts = line.split(";"); if (parts.length != 2) { throw new IOException("Format error in file " + JLanguageTool.getDataBroker().getFromRulesDirAsUrl(getFileName()) + ", line: " + line); } map.put(parts[0], parts[1]); } } finally { if (br != null) { br.close(); } if (isr != null) { isr.close(); } } return map; } public void reset() { } } Here is what I need the SimpleReplaceRule.java to do: 1 - Be able to have more than two spelling variations in the coherency.txt file (right now it can only be Word1;Word2). 2 - Find the first use of ANY of the spelling variations in a document that are found in coherency.txt and then make sure only that spelling is used throughout the document (ex. in the coherency.txt I have Word1;Word2;Word3 then in my document on the first line I write Word2. then on next line I write Word1 and Word 3 - then the grammar checker will flag Word1 and Word3 saying that I should use the spelling "Word2" instead...etc.). If anyone can help I would be grateful! Thanks for your time, Nathan

    Read the article

  • How has RIA Technology and what technology stack currently rules this domain ?

    - by Rachel
    I am new to RIA and have not been actively with this technology with all my projects as all of them we using server side Java Technology but I want to gain some experience with RIA and so my question is How has RIA Technology evolved and what technology stack currently rules this domain ? What are the recommended resources for learning RIA and in general what is the suggested approach to get started on RIA Journey ? Thanks.

    Read the article

  • Rsync: pure Ruby implementation?

    - by peter
    I have a Rsync program Deltacopy with an executable as client and server but would like to replace this if possible with a pure Ruby implementation of Rsync. I found gems like six-rsync and rsync-update but they seem to be no general implementations. I'm looking for a pure Ruby solution, so no executables involved and preferably runnable on multiple OS. If possible a simple sample would be great. I only look for Rsync, no other transfer or backup solutions please.

    Read the article

  • Is the Angular templateCache shared between apps? Is it persistent?

    - by alexp
    If I have two Angular apps that run on the same domain, will/can they share data in the templateCache? Or is the cache unique to each main application module? In general I'm trying to understand what dictates when a new templateCache is created. Furthermore I'm not clear on whether or in what way the templateCache is persistent? Looking in local storage and cookies, I don't see where anything is getting stored.

    Read the article

  • Using a Windows 7 style menustrip in Windows Forms

    - by Nilbert
    I am using windows forms and when I use a MenuStrip item, I get something that looks like this: http://imgkk.com/i/ggn1.png Is it possible to use menu strips like the ones the system uses, like in Windows Explorer, or Firefox, for example: http://imgkk.com/i/cxyg.png with Windows Forms, or C# in general?

    Read the article

  • BerkeleyDB vs. Tokyo Cabinet

    - by vsedach
    I'm looking for general experiences from people who have used both, particularly on how the two compare on handling large numbers of records, transaction/concurrency/deadlock handling, and juicy stories about database corruption and backup procedures.

    Read the article

  • When should I use Dependency Injection and when utility methods?

    - by Roman
    I have a Java EE project with Spring IoC container. I've just found in Utils class static method sendMail(long list of params). I don't know why but I feel that it would look better if we had separate class (Spring bean with singleton scope) which will be responsible for sending email. But I can't find any arguments which can prove my position. So, are there any pros (or cons) in using DI in this (rather general) situation?

    Read the article

  • X (close) shape in SVG

    - by danke
    I'm trying to make this SVG shape (ignore the color background, just the X shape) Close SVG Path but don't have Illustrator and wouldn't know how to use it. Can someone help out with the general idea, or point me to alternatives. I'm using it in flex.

    Read the article

  • What are the benefits of left outer join vs nested aggregate selects to find the newest rows in a table?

    - by RenderIn
    I'm doing: select * from mytable y where y.year = (select max(yi.year) from mytable yi where yi.person = y.person) Is that better or worse from a performance aspect than: select y.* from mytable y left outer join mytable y2 on y.year < y2.year and y.person = y2.person where y2.year is null The explain plan/anecdotal evidence is inconclusive so I am wondering if in general one is better than the other.

    Read the article

  • Trap error or 'Resume Next'

    - by Craig Johnston
    I realise this is an older programming environment, but I have to clean up some VB6 code and I am finding that most of it uses: Resume Next What is the general consensus about the use of Resume Next? Surely, if there is an error, you would want the app to stop what it was doing, rollback any data changes, and inform the user of the error, rather than just resuming. When is it good idea to use Resume?

    Read the article

  • CFBundleDocumentTypes & UIFileSharingEnabled issues

    - by carloe
    Has anyone gotten UIFileSharingEnabled or CFBundleDocumentTypes to work? I added UIFileSharingEnabled as true to my plist and used Apple's example from the link below for CFBundleDocumentTypes, but can't seem to get it to work. I don't see my app under file sharing in iTunes, and I do not get the option to open documents I registered in my app when I click on them in the mail.app http://developer.apple.com/iphone/library/documentation/General/Conceptual/iPadProgrammingGuide/CoreApplication/CoreApplication.html

    Read the article

  • What is the object of the Contact application search option ?

    - by Spredzy
    Hi all, I am wondering what is the kind of object that shows up when in the Contact application, you hit search option, what is it ? a Custom Quick Search Bar, a custom notificaction bar, other idea ... An image of what I am talking about is available here : http://www.developpez.net/forums/attachments/p60921d1270798944/java/general-java/java-mobiles/android/cet-objet-image-jointe/screen-shot-2010-04-09-at-9.37.38-am.png/ Thank you all

    Read the article

  • Twitter Service Proxy in C#

    - by Dave Swersky
    Does anyone know of a Twitter service proxy in particular, or a general-purpose REST service proxy that I could install on my own server, written in C#? The point here is to direct Twitter service queries to my service that are passed-through to Twitter.

    Read the article

  • Open Technology: Nanorobots Answer to US Navy

    - by adrianocavalcanti
    Hi Everybody, Just wondering if some has some suggestion about open technology licensing. I have been working on nanotechnology -- here some info: * Nanorobot Technology: What to Expect from Science - A Personal Letter in Answer to United States Navy http://www.linuxquestions.org/questions/general-10/nanorobot-technology-what-to-expect-from-science-814060 and started an initiative towards open nanotechnology since last october. All comments and suggestions are highly appreciated.

    Read the article

  • How does 'binding' in JSF work?

    - by Roman
    I've created custom component which shows chart. Now I need to make binding support for this component i.e. generated chart-image should be available (as array of bytes) to backing bean via binding mechanism. I'd like to know some general info about binding implementation techniques. Any links and examples are welcome as well. Thanks in advance!

    Read the article

  • Best practice for handling ConnectionDroppedHandler in OCS Server Application

    - by Paul Nearney
    Hi all, In general, it seems that the majority of times that ConnectionDroppedHandler would get called in an OCS server application is for expected reasons e.g. server application has been unregistered, server is shutting down, etc. Are there any unexpected situations in which ConnectionDroppedHandler can be called? Basically, i'm wondering whether it will ever be necessary to log an error to the event log from this event handler. Many thanks, Paul

    Read the article

  • Operator Overloading in C

    - by Leif Andersen
    In C++, I can change the operator on a specific class by doing something like this: MyClass::operator==/*Or some other operator such as =, >, etc.*/(Const MyClass rhs) { /* Do Stuff*/; } But with there being no classes (built in by default) in C. So, how could I do operator overloading for just general functions? For example, if I remember correctly, importing stdlib.h gives you the - operator, which is just syntactic sugar for (*strcut_name).struct_element. So how can I do this in C? Thank you.

    Read the article

  • Best Way to Include Debug Code?

    - by stormin986
    I am programming Android applications, and the best way here may or may not be the same as Java in general. I simply want to be able to set a debug flag that will only execute certain portions of code when it's set to true––equiv to C++ setting a preprocessor #define DEBUG and using #ifdef DEBUG. Is there an accepted or best way to accomplish this in Java? Right now I'm just going to set a variable in my Application object, but I don't imagine this is the best way.

    Read the article

  • dark VS2008, Windows 7 theme, configuration

    - by Aurelius
    So there's plenty of vs.settings files for nice dark syntax highlighting in VS2008, but I find them basically unusable since they're surrounded by an otherwise white visual studio application and general windows environment. I'd like an adequate dark windows 7 theme I can use while coding in VS. All of the 3rd party Win7 themes (that utilize the patched system files) I've come across have had fairly major problems and were unusable for one reason or another. Does anyone out there have a dark theme + VS combination they're actually happy with?

    Read the article

  • Simple question about MKMapView and the iPhone

    - by gravityone
    Basically I want to show the users location plus a list of selected location on a map. It can even have the standard iphone annotations. But, I have no idea of the general steps I would take to achieve this. Would I use MKMapView, or Core Location, or both? Could someone give me a simple outline of steps to take, or a link to a good tutorial or sample code. Thanks

    Read the article

  • Finding patterns in source code

    - by trex279
    If I wanted to learn about pattern recognition in general what would be a good place to start (recommend a book)? Also, does anybody have any experience/knowledge on how to go about applying these algorithms to find abstraction patterns in programs? (repeated code, chunks of code that do the same thing, but in slightly different ways, etc.) Thanks Edit: I don't mind mathematically intensive books. In fact, that would be a good thing.

    Read the article

  • Why is cell phone software still so primitive?

    - by Tomislav Nakic-Alfirevic
    I don't do mobile development, but it strikes me as odd that features like this aren't available by default on most phones: full text search: searches all address book contents, messages, anything else being a plus better call management: e.g. a rotating audio call log, meaning you always have the last N calls recorded for your listening pleasure later (your little girl just said her first "da-da" while you were on a business trip, you had a telephone job interview, you received complex instructions to do something etc.) bluetooth remote control (like e.g. anyRemote, but available by default on a bluetooth phone) no multitasking capabilities worth mentioning and in general no e.g. weekly software updates, making the phone much more usable (even if it had to be done over USB, rather than over the network). I'm sure I was dumbfounded by the lack or design of other features as well, but they don't come to mind right now. To clarify, I'm not talking about smartphones here: my plain, 2-year old phone has a CPU an order of magnitude faster than my first PC, about as much storage space and it's ridiculous how bad (slow, unwieldy) the software is and it's not one phone or one manufacturer. What keeps the (to me) obvious software functionality vacuum on a capable hardware platform from being filled up? Edit: I believe a clarification on the multitasking point might be beneficial. I'll use my phone as an example, although the point is much more general. The phone can multitask and in fact does: you can listen to music and do something else at the same time. On the other hand, the way the software has been designed makes multitasking next to useless. (Ditto with the external touch screen: it can take touch commands, but only one application makes use of it, and only with 3 commands.) To take the multitasking example to the extreme, if I plug my phone into my laptop and it registers as an external disk, it doesn't allow any kind of operation: messages, calling, calendar, everything out of reach, although I can receive a call. No "battery life" issue there: it's charging while connected. BTW, another example of design below the current state of the art: I don't see a phone on the horizon which will remember where in an audio or video file you were when you stopped listening/watching it last time (podcasts are a good use case). Simplistic rewind/fast forward functionality only aggravates the problem.

    Read the article

< Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >