Strings: plural to singular

I'm working on an English to Spanish translation program and am stumped on a method.
The following method is supposed to take a plural Spanish noun and change it to a singular Spanish noun. In my limited understanding of Spanish, a word will end in "es" or "s". First I test if it ends in "es", and if it does I chop off the last two letters. This works for things like calcetines -> calcetin. However, there are words that end in 'e' without being plural, cause things like clases -> clas instead of clase. To fix that, I made it check through all the Spanish words in my array. If the word, chopped, with an 'e' matches one of the words, I add an 'e' on the end. This part doesn't work, as far as I can tell. The rest of the code is just for if it end with a plain old 's'.
     String SPluralToSingular(String word) {
          if (word.substring(word.length()-2, word.length()).equals("es")) {
               word=word.substring(0,word.length()-2);     
               for (int i=0;i<spanishWord.length;i++) { //Check if it wrongly killed 'e'
                    if ((word+"e").equals(spanishWord)) word+="e";
          } else if (word.charAt(word.length()-1)=='s') {
               word=word.substring(0,word.length()-1);
          return word;
Sample outputs:
mesas -> mesa (correct)
calcetines -> calcetin (correct)
clases -> clas (BAD!)

This is a list of nouns, so things like adios do not apply.
I know that I can't chop off the 'es' and do nothing else. It doesn't work when the 'es' was the result of a noun ending with an 'e' being put into plural form. If I can detect when a word exists that would make it true that the above went wrong (word without 'es' + 'e' is a valid word), then I can add the 'e' back on.

Similar Messages

  • Treat plurals as singular

    I have a sinking feeling I know the answer to this one, but I hope I'm wrong...
    I want to ask if there is a way to get Oracle Text to regard plural and singular forms of a word as equivalent that does NOT involve creating synonyms in a thesaurus (because I don't fancy re-writing a dictionary, basically!).
    I have no problem using a thesaurus to make roof=rooves or mouse=mice, but I'm looking for a way to generically allow pencil=pencils or paper=papers. Right now, they're not:
    SQL> create table texttst (col1 varchar2(20));
    Table created.
    SQL> insert into texttst values ('pencil');
    1 row created.
    SQL> insert into texttst values ('pencils');
    1 row created.
    SQL> insert into texttst values ('paper');
    1 row created.
    SQL> insert into texttst values ('papers');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create index txtidx on texttst(col1) indextype is ctxsys.context;
    Index created.
    SQL> select count(*) from texttst where contains(col1,'pencil')>0;
      COUNT(*)
             1I want the answer to that last query to be 2!
    I am aware I can do this:
    SQL> select count(*) from texttst where contains(col1,'$pencil')>0;
      COUNT(*)
             2But the use of 'fuzzy' searches goes much wider than simply seeing singular as the same as plural forms of a word, and that's not something I particularly want to do if I can help it.
    Is there some switch that says "plural=singular", please?

    The default basic_wordlist with english stemmer merely makes stemming searches possible. The basic_lexer with index_stems makes stemming searches faster. It does this by determining during indexing which tokens correspond to which stems. These values are added to the dr$...$i domain index table with a token_type of 9. Then when a stemming search is done it can quickly find which tokens are associated with which stems by just searching for those with token_type = 9. Your stemming search may then even end up faster than your non-stemming search. You will need to do some tests on your own system to determine the impact. Please see the demonstration below. There are some conflicts between the documentation and what I see on my system. I don't see any way to modify the stemming dictionary or display values from it.
    SCOTT@orcl_11g> -- test table and data:
    SCOTT@orcl_11g> create table texttst (col1 varchar2(30))
      2  /
    Table created.
    SCOTT@orcl_11g> insert all
      2  into texttst values ('pen pencil')
      3  into texttst values ('pens pencils')
      4  into texttst values ('pens pencilcase')
      5  select * from dual
      6  /
    3 rows created.
    SCOTT@orcl_11g> insert into texttst select object_name from all_objects
      2  /
    68796 rows created.
    SCOTT@orcl_11g> column token_text format a30
    SCOTT@orcl_11g> -- without basic_lexer and index_stems:
    SCOTT@orcl_11g> create index txtidx on texttst(col1) indextype is ctxsys.context
      2  /
    Index created.
    SCOTT@orcl_11g> select token_text, token_type, token_first, token_last, token_count
      2  from   dr$txtidx$i
      3  where  token_text like 'PEN%'
      4  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    PEN                                     0           1          1           1
    PENCIL                                  0           1          1           1
    PENCILCASE                              0           3          3           1
    PENCILS                                 0           2          2           1
    PENDING                                 0         235      61171          49
    PENDINGEXCEPTION                        0       28535      28536           2
    PENS                                    0           2          3           2
    7 rows selected.
    SCOTT@orcl_11g> exec dbms_stats.gather_table_stats (user, 'TEXTTST')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> set timing on
    SCOTT@orcl_11g> set autotrace on explain
    SCOTT@orcl_11g> select * from texttst where contains (col1, 'pen pencil') > 0
      2  /
    COL1
    pen pencil
    1 row selected.
    Elapsed: 00:00:00.07
    Execution Plan
    Plan hash value: 472101605
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     1 |    24 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXTTST |     1 |    24 |     0   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TXTIDX  |       |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("COL1",'pen pencil')>0)
    SCOTT@orcl_11g> select * from texttst where contains (col1, '$pen $pencil') > 0
      2  /
    COL1
    pen pencil
    pens pencils
    2 rows selected.
    Elapsed: 00:00:00.08
    Execution Plan
    Plan hash value: 472101605
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     2 |    48 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXTTST |     2 |    48 |     1   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TXTIDX  |       |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("COL1",'$pen $pencil')>0)
    SCOTT@orcl_11g> set autotrace off
    SCOTT@orcl_11g> set timing off
    SCOTT@orcl_11g> -- with basic_lexer and index_stems:
    SCOTT@orcl_11g> drop index txtidx
      2  /
    Index dropped.
    SCOTT@orcl_11g> begin
      2    ctx_ddl.create_preference ('test_lex', 'basic_lexer');
      3    ctx_ddl.set_attribute ('test_lex', 'index_stems', 'english');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> create index txtidx on texttst(col1) indextype is ctxsys.context
      2  parameters ('lexer test_lex')
      3  /
    Index created.
    SCOTT@orcl_11g> select token_text, token_type, token_first, token_last, token_count
      2  from   dr$txtidx$i
      3  where  token_text like 'PEN%'
      4  /
    TOKEN_TEXT                     TOKEN_TYPE TOKEN_FIRST TOKEN_LAST TOKEN_COUNT
    PEN                                     0           1          1           1
    PEN                                     9           2          3           2
    PENCIL                                  0           1          1           1
    PENCIL                                  9           2          2           1
    PENCILCASE                              0           3          3           1
    PENCILS                                 0           2          2           1
    PENDING                                 0         235      61171          49
    PENDINGEXCEPTION                        0       28535      28536           2
    PENNSYLVANIA                            9       46853      65539           7
    PENS                                    0           2          3           2
    10 rows selected.
    SCOTT@orcl_11g> exec dbms_stats.gather_table_stats (user, 'TEXTTST')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> set timing on
    SCOTT@orcl_11g> set autotrace on explain
    SCOTT@orcl_11g> select * from texttst where contains (col1, 'pen pencil') > 0
      2  /
    COL1
    pen pencil
    1 row selected.
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 472101605
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     1 |    24 |     0   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXTTST |     1 |    24 |     0   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TXTIDX  |       |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("COL1",'pen pencil')>0)
    SCOTT@orcl_11g> select * from texttst where contains (col1, '$pen $pencil') > 0
      2  /
    COL1
    pen pencil
    pens pencils
    2 rows selected.
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 472101605
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     2 |    48 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEXTTST |     2 |    48 |     1   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | TXTIDX  |       |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("COL1",'$pen $pencil')>0)
    SCOTT@orcl_11g> set autotrace off
    SCOTT@orcl_11g> set timing off
    SCOTT@orcl_11g>

  • How do I change a keyword from plural to singular?

    Ex: I have windmill and windmills as keywords.  I want them all to be windmill.  It won't let me change windmills to windmill because it says it already exists.  If I delete it, it deletes it from all the images that use the plural keyword. 

    Sort of.....the number in the Keyword List shows the correct number of files with that particular keyword, clicking on that should populate the grid with those files. But stacking can be a confusion....if there's a closed stack or two with that keyword, all you see in the grid are the images at the top of the stack plus those not in a stack. In that event the library filter above matches the number of thumbnails showing in the grid, which will be lower that the actual number in the keyword list.
    A bigger confusion is if there's a closed stack with the top image NOT having that keyword, but one or more images in the stack do have that keyword. In that situation, the stack is simply not displayed at all when clicking on the arrow to the right of the keyword in the keyword list.
    Obvious solution is to expand all stacks, but that has to be done with filters off, as doing it while in a filtered search seems to have no effect.

  • Module_webapps and liquid layouts

    Hello,
    I have been playing around on the beta server and had some questions on how to use module_webapps with the liquid language on BC. my question is what is the best way to test the new features of the module_webapps tag:
    {module_webapps id="webappId|webappName" filter="item" itemId="123" targetFrame="" useBackupTemplate="false" resultsPerPage="" hideEmptyMessage="false" rowCount="" sortType="ALPHABETICAL" collection="my_custom_collection_name" template=""}
    I am able to create some JSON data via: 
    {module_webapps,22762,a template="/webapp-list.tpl"}
    but I am not able to use the new named parameters and create a collection: 
    {module_webapps id="22762" template="" collection="my_custom_collection_name"}
    I was thinking I could output the data to the page via:
    {{my_custom_collection_name | json}}
    I was successful with this:
    {module_shoppingcartsummary collection="my_custom_shopping_cart" template=""}
    {{my_custom_shopping_cart | json}}
    Is this module working the same way or am I understanding this wrong?
    Thanks,

    Ok I realize I'm late replying to this thread but Liam, I don't think you're understanding what we're saying because nothing you're saying refutes it.  Look, what we're saying is that whatever the default is, you should not have to specifically state it to make the web app itself work.  I don't care if the default filter is 3 items for filter="All".  You should not have to specifically state filter="All" for the web app to work.  You keep on talking about load on the servers but what we're talking about has absolutely nothing to do with load.  The load on the server is determined by what the limits are for filter="all", not whether or not you have to state it in the markup.  I'm not sure why you aren't understanding that.
    Again, the default filter="all" could be only 3 web app items and my point is still the same.  To get those 3 web app items to show should absolutely NOT require me to add a filter="all" to the markup. 
    In other words, if you just write {module_webapps, id="mywebappname"}, I'm okay if the output results in 500 items, 10 items, 1 item, or whatever BC wants filter="all" to represent.  But it should never be ZERO items like what we currently have. Otherwise the API fails the intuitive test.
    And on a sidenote, there's also some inconsistency regarding using plural vs singular for this module.  In my opinion, it should have been {module_webapp} because you're only referencing 1 web app.  For displaying a photo gallery, we don't use {module_photogalleries}, we use {module_photogallery}. Same for blogs and forums.  I think the webapp and breadcrumb modules are the only ones wrongly using the plural form.  One of the hallmarks of a great API or framework is consistency if at all possible because with that consistency comes intuitiveness.

  • Adobe CC 2014

    Quiero descargar un par de app's de ACC 2014, pero a la hora de abrir el programa no se carga... ...¿alguien me puede ayudar con esto? necesito usar cuanto antes estas aplicaciones y esto no responde, estoy perdido y necesito ayuda, gracias.

    Ustedes son: you are (plural)
    Usted es: you are (singular, polite form)
    Tu eres: you are (singular, "casual" / friendly form)
    Bienvenidos : plural
    Bienvenido: singular
    Now if you wish to say you're welcome in that context you would rather use, for example:
    "No hay de que" (no reason to thank which is something like "it was a pleasure helping out, no need to thank")
    or
    "de nada" (for nothing, which would mean thanks for nothing, similar to the prior form)
    hahaha, express spanish classes

  • Catalog Split?

    So far most of my non client pics are contained within one catalog and it is
    rather large. Even though I have the folders which contain the pics sorted
    by date and then what was shot, it still is getting larger than I want and
    my thought is to now split it up by year.
    With this said, I have explored around the forums and the help file to no
    avail although I did notice the option under the file menu to 'export
    catalog', but I am not sure that will accomplish what I am after. Basically
    I just want to take things the way they stand now with any and all
    adjustments, etc... and move all folders that start with '2008' in a '2008'
    catalog and so on. How can I easily and successfully achieve this without
    issue(s)?
    Any and all help is much appreciated!

    Thanks for the response. Guess my concern is that having 'all my eggs in one <br />basket' may haunt me one day. Am I correct in assuming this? The reason I <br />ask is because the nature of the second paragraph of your response seemed to <br />indicate that splitting this up may not be a good idea.<br /><br />Only reason I had thought it may be was because of items I had read on this <br />forum.<br /><br />Can other users please interject?<br /><br />Thanks much.<br /><br /><br /><br /><[email protected]> wrote in message <br />news:[email protected]..<br />> Use Export as Catalog, unticking the Include Negatives option. Then remove <br />> those files from your main catalogue.<br />><br />> Next time you want to search by a particular keyword, remember to search <br />> through all your catalogues because your work is now scattered into <br />> different ones. Remember that now there's no one keyword list, their <br />> spellings may vary or they may be plural or singular in different <br />> catalogues. Remember that any collections of similar or related images are <br />> now broken up among different catalogues. Next time a new version of LR <br />> requires a catalogue update, remember to update all your catalogues. And <br />> try to figure out how much you really gained by breaking up control of <br />> your pictures into all those catalogues....<br />><br />> John

  • Oracle Naming conventions

    Hi everyone,
    I wanted to ask you about Oracle Naming Conventions. I've found a lot of stuff on the internet. Here's a short summary of what I've discovered so far...
    These are absolute:
    1- All names should be between 1 & 30 characters (database names accept 8 characters max)
    2- Names can not be duplicated in the same namespace
    indexes, constraints... are in one "schema" namespace
    tables views... are in another "schema" namespace
    3- Only letters (lower & upper), numbers and $, # & _ are accepted in a name.
    4- Quoted identifier are case sensitive and accept all kind of characters.
    The previous rules can not be violated otherwhise the object won't be created.
    Now they are a lot of naming conventions...
    - Always use a plural names for table (USERS i.o. USER)
    - use a prefix or suffix in constraint, indexes, ...
    USERS_PK, USER_IDX...
    I want to talk about these. What are your own naming conventions?
    Thanks

    user13117585 wrote:
    Hi everyone,
    Well actually I am currently trying to make a document for my company. All the developers will need to follow the rules I'm writing.
    "It's good to be the king!"
    My problem is that, I have many databases with hundreds schemas and I want to normalize everything (no only me want that but the management too). Anyway,
    - Some people are still using only 8 letters for object names (tables, views, constraints...). Names are cryptic. I spend like an hour to understand what means DRPOLDSZ. And table columns are also limited to 8 characters (what could DELLOLCN mean??)
    - Some developers are using other conventions. A good Table example would be:
    TABLE DOSSIERS
    DOS_DOSSIER_ID
    DOS_NUMBER
    DOS_CREATION_DATE
    I hate that prefix in each column too;
    As do I. Going back to data normalization .... the prefix adds nothing.
    >
    - Some developers use other conventions
    some have table names in plural, others singular
    some don't use the _ to separate multiple words object names, some well
    some prefix table id some use postfix (id_table vs table_id)
    etc etc.
    I want to normalize all the databases to use one and only one convention; I already thought about it and wanted to know what you all have in place; how do you manage to have all your developers using the same conventions ?
    About [ http://ss64.com/ora/syntax-naming.html| http://ss64.com/ora/syntax-naming.html] (1) article, I've read it but, I don't agree with the guy on everything. He mostly uses prefix (pk_Table, idx_table, fk_table). When you give some thoughts, isn't it better to use suffix?
    Table_PK, Table_IDX, ...
    When you do a query on ALL_ or USER_OBJECTS, you can order them on OBJECT_NAME and have the name groupped together.
    I also prefer to have in the constraint name the base table and the referenced table. Instead of what the guy propose FK_TABLE_NAME, something like TABLE_NAME_REF_OTHER_TABLE_FK
    Well, you don't have to slavishly follow anyone else's document. Again, you are using those for ideas. In the end, you need to do what makes sense to you. Also realize that having A standard - almost ANY standard - is better and more important that sweating the pros-and-cons of any particular detail. Just make a decision and go with it. Get management to sign off on it as the standard.
    My question is not really a question but more a how do you handle all kind of developers and what is the best way to force them to normalize and use the same conventions...The only way to force it is to take "CREATE object" away from the developers. This is actually done in many shops. If you can't do that, then at least set yourself a task of auditing and going back to violators. If you get some recalcitrant violators, elevate it to management - who you had sign off on it.

  • Sql Developer Data Modeler 3.0 EA1: Engineering singular to plural

    Do you have a strategy for how I engineer all my singular entity names (such as EMPLOYEE) into plural table names (such as EMPLOYEES)?
    - Marc de Oliveira

    Obviously, a property called "Plural" and an option for engineering using "Plural" names instead of entity names.
    This would also allow us to have a nice relationship report where we could translate relationships into natural languages, like this:
    Each DEPARTMENT may be employing one or more EMPLOYEES.
    / Marc

  • JTextPane.setText(String) - New line problem

    Hello.
    I'm usin a JTextPane for a small editor I need.
    I'm using it for it's ability to use HTML format codes (<font color = #color>string</font> for a singular line);
    Now, It's loading lines from a text file. Then, I made a function to parse the array data into a singular string, and return it.
    It's along the lines of
    String parseArrayToString(String[] data) {
        String returnString = "";
        for(String s : data)
            returnString += s+"\n";
        return returnString;
    }This worked for JTextArea, but not for this.
    Is there any way to do this using JTextPane?

    More or less straight from from the number 2 google hit...
    package forums;
    // a slighty cleaned up version of:
    // http://www.java2s.com/Code/Java/Swing-JFC/JTextPanedemowithvariousformatandhtmlloadingandrenderering.htm
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.IOException;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.Document;
    import javax.swing.text.AttributeSet;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.SimpleAttributeSet;
    import javax.swing.text.StyleConstants;
    public class JTextPaneDemo extends JPanel
      private static final long serialVersionUID = 1L;
      private static final SimpleAttributeSet ITALIC_GRAY = new SimpleAttributeSet();
      private static final SimpleAttributeSet BOLD_BLACK = new SimpleAttributeSet();
      private static final SimpleAttributeSet BLACK = new SimpleAttributeSet();
      static {
        StyleConstants.setForeground(ITALIC_GRAY, Color.gray);
        StyleConstants.setItalic(ITALIC_GRAY, true);
        StyleConstants.setFontFamily(ITALIC_GRAY, "Helvetica");
        StyleConstants.setFontSize(ITALIC_GRAY, 14);
        StyleConstants.setForeground(BOLD_BLACK, Color.black);
        StyleConstants.setBold(BOLD_BLACK, true);
        StyleConstants.setFontFamily(BOLD_BLACK, "Helvetica");
        StyleConstants.setFontSize(BOLD_BLACK, 14);
        StyleConstants.setForeground(BLACK, Color.black);
        StyleConstants.setFontFamily(BLACK, "Helvetica");
        StyleConstants.setFontSize(BLACK, 14);
      private JTextPane textPane = new JTextPane();
      public JTextPaneDemo() {
        textPane.setPreferredSize(new java.awt.Dimension(640, 480));
        JScrollPane scrollPane = new JScrollPane(textPane);
        add(scrollPane, BorderLayout.CENTER);
        appendText("\nHere's", BLACK);
        appendText(" Duke Baby", BOLD_BLACK);
        appendText("!\n\n", BLACK);
        textPane.insertIcon(new ImageIcon("C:/Java/home/src/crap/Java2D/images/duke.gif"));
        appendText("\n\nIsn't he just so cute ;-)\n\n", ITALIC_GRAY);
        JButton btnLoad = new JButton("Load web-page: The Java Tutorials");
        btnLoad.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              textPane.setEditable(false);
              try {
                textPane.setPage("http://java.sun.com/docs/books/tutorial/");
              } catch (IOException e) {
                e.printStackTrace();
        textPane.insertComponent(btnLoad);
        setVisible(true);
      private void appendText(String text, AttributeSet attributes) {
        try {
          Document doc = textPane.getDocument();
          doc.insertString(doc.getLength(), text, attributes);
        } catch (BadLocationException e) {
          e.printStackTrace();
      private static void createAndShowGUI() {
        JFrame frame = new JFrame("JTextPane Demo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(new JTextPaneDemo());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            createAndShowGUI();
    }Cheers. Keith.

  • Leading zeros in item strings

    We've recently done a system upgrade to 11.5.10.2. One of the problems we've found since the upgrade is that the Segment 2 from the item description strings has lost its leading zeros. Our string is in the format xxx-0000-0-xxx with segment 1 being the family, 2 being an item number within the family, 3 being the item level, and 4 being a manufacturer id. We previously didn't have any problem with missing leading zeros.
    What was previously ERT-0101-1-ABC is now showing as ERT-101-1-ABC. If this were purely for display purposes it wouldn't be too important, but it's affected some of our interfaces and reports. Even wiithin the standard inventory/mrp/order management screens, the item format changes depending on the individual form.
    It looks as if different screens/functions treat items in different ways - sometimes treating the string as a whole, other times apparently working each segment separately and then displaying a concatenated, lead zero less string. In the System Item segments value set for segment 2, I can see that Right-justify and Zero-fill Numbers is switched on. Is it this option that's failing?
    We've already implemented some fixes by padding the segment out as we produce the XML files we need for export, but before we get our support contractors to build fixes in all over the place I thought I should ask if there's a more singular fix for this.
    I can see some rather old issues logged in Oracle Support, but not a recent one related to this upgrade and zeros going missing.
    Any help gratefully received. :)

    Yes, the format validation for it is number. I'm reasonably certain it always used to be number, though.
    Should their be any detriment elsewhere if I had it changed to Char?
    The field (in our test system) is protected against update - how can I remove the protection to test this?
    Thanks for your help so far :)

  • ResourceManager support for single-plural, feminine-masculine cases

    Hello,
    I am developping a large scale website with support for multiple languages.
    I am using the ResourceManager to manage the switch of languages by the user. It works OK, but I have some cases where I cannot find
    a proper solution.
    I wan to display different strings for plural and single cases. For example:
    You have 1 image
    You have 3 images
    And I want to do it automatically, not through asking in the code:
    if (numImages > 1) { display (ResourceManager.getString(locale,images_string_from_properties_file)} else {
                             display (ResourceManager.getString(locale,image_string_from_properties_file)} .
    There is a solution for that using a gnu utility xgetText, where you generate for each msg-string a single and plural versions, but it does not work
    well with AS3 (or any other AS), since it is based on C. (it is explained in
    http://www.sephiroth.it/phpwiki/index.php?title=Gettext_actionscript3
    , but does not cover the problematic issues, and so has no advantage over ResourceManager).
    The same issue goes for languages where the feminine and masculine differ - like arabic and hebrew (and probably others).
    Has any one dealt with these issues before ?.
    Thanks
    Elisheva

    You'll need different tags for each string in the bundle.  If you put your own layer over that, that might be an excellent thing to share with others.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • String stemming

    hi everyone,
    i have a program that searches a file for a string. i need to be able to implement functionality to this progam so that it can find like strings. for example when i search for run, i want runner and running to also be displayed as well as run, i have thought about just storing an array of possible stems and searching for them aswell as the original string, however this wont suffice as i need to be able stem strings that aren't always familiar to me. i have included my search method code, i search a file by first reading it into a string and then spliting this string into other strings; title, abstract, body, keyword and index. i am then searching each of these strings for a target string using the indexof(). does anyone have any idea how i will be able to implement string stemming functionality to this?
    public void search() {
            String paf = pathText.getText();
            path = new File(paf);
            target = searchText.getText();
            if (path.isFile()){
                searchfile(paf);
            if (path.isDirectory()){
                //folderlen = path.length();
                processdir(path);
            MouseListener ml = new MouseAdapter() {
               public void mousePressed(MouseEvent e) {
            if ((list.getSelectedIndex() != -1) && (e.getClickCount() == 2))  {
                String selection = (String)list.getSelectedValue();
                display(selection);
                    list.addMouseListener(ml);
        public void processdir(File path) {
            int i;
            File[] theFiles = path.listFiles();
            for (i = 0; i < theFiles.length; i++) {
                if(theFiles.isDirectory()){
    //theFiles = path.listFiles();
    processdir((theFiles[i]));
    if(theFiles[i].isFile()) {
    String pop= theFiles[i].getAbsolutePath();
    //System.out.print(pop+"\n");
    searchfile(pop);
    //list.setListData(files);
    public void searchfile(String pah){
    pqs = new File(pah);
    String co = readFile(pqs);
    ArrayList text = documentSpliter(co);
    int rank = 0;
    String pan = pqs.getName();
    String st= pqs.getPath();
    if (title.indexOf(target)>=0) {
    rank+=10;
    files.add("\nthe string was found in the title");
    boolean intit = true;
    if (abs.indexOf(target)>= 0) {
    rank+=5;
    files.add("\nthe string was found in the abstract");
    boolean inabs = true;
    if (body.indexOf(target)>= 0) {
    rank+=2;
    files.add("\nthe string was found in the body");
    boolean inbod = true;
    if (keyword.indexOf(target)>= 0) {
    rank+=3;
    files.add("\nthe string was found in the keyword");
    boolean inkey = true;
    if (index.indexOf(target)>= 0) {
    rank+=2;
    files.add("\nthe string was found in the index");
    boolean inind = true;
    if (rank==0){
    files.add("\nword not found in file");
    boolean eof = true;
    if((rank!=0)) {
    files.add(pan+" "+"rank score:"+rank);
    files.add("\nthe document "+pan+" has rating:"+rank+"\n\n");
    files.add("\n");
    files.add(st+"\n");
    list.setListData(files);

    I think the only likely approach is to have a table of common word extensions ("-es" "-ing" "-ed" "-ly" and so on). You might extend that to actual rules (e.g. for plural formation) and exceptions.

  • Search issue with plurals?

    RH9, webhelp, merged project.
    Just reported to me and I can confirm: There seems to be a content search issue where the singular works, but not the plural, even if the plural is what we use. Specific example: Enhancement vs. Enhancements. We have several topics that are labeled or refer to "Enhancements", but searching with that term finds nothing, while using "Enhancement" finds those terms.
    "Ticket" vs "Tickets" results in a similar issue. The behavior appears to be that the singular form can find either version - singular or plural - but plural search terms result in no matches at all.
    Any ideas what may be causing this?

    Are you testing on the published help or the generated help. The latter is rebuilt every time.
    Try in one of the sample projects. Click Open on the RoboHelp Starter page and then click Samples in the ribbon on the left.
    If that works, try downloading the demo merged help from my site and generate from that. Test that works.
    Post back with the results at that point.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • FindChangebyList with strings of text?

    I'm trying to setup a findchangebylist document to change strings of text to match my company's verbiage. I've been successful changing items like:  $10.00 to read as $10 but I cannot get regular text like:  over-sized to read as oversized
    More examples of text I'm trying to convert:
    over-sized to oversized
    CAT to CAT(R)   (adding the registration mark)
    screenprint to screen print
    Is this possible with this script?? There's over 100 words that follow this mindset. The custom dictionary isn't something that works, as it only checks for single words and not 2 words with a space inbetween.
    Anything would be helpful.
    Thanks!

    Hi Trevor:
    I have to admit, I like your script (The syntax for the arrays is pretty clean, esp. with the tags) but we don't need to completely reinvent the wheel, and we have a lot of functionality within the FindChangeReplace script that wouldn't need too many more additions.
    nukleas wrote:
     There is the conflict of case sensitivity and some words you don't want to close up. A good example of this is in official titles (So you don't want to close up Over-All Program Goals 2012, but you are fine closing up over-all goals or over-stated nature.
    By adding a tag at the begining of words one wants to be stictly case sensertive one can deal with this
    By useing slice and toUpperCase() one can make sure that over-sized becomes oversized and Over-sized becomes Oversized.
    In the case that one only wants the upper case to be changed that would not need tagging i.e. in our example only CAT would become CAT®, cat would stay the same.
    To avoid Over-All being closed one also would not need to tag it because of the capitol A of All.
    One would only need to tag something like Over-all if one did not want it to become Overall but wanted over-all to become overall.
    True, but why don't we just add this to FindChangeReplace:
    grep     {findWhat:"(Over|over)-(?!\\u|\\d)(\\S*)"}     {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    This way we don't need to write any more javascript code, and we preserve the features from that script, especially the option to do the search on individual stories or selections rather than the whole document, which is default for the script (I see these things usually from an inCopy standpoint, where you are working closely with the text) Having an easily editable text document as a list of things is probably not a bad idea either.
    We also catch any hyphenations of digits (which we ought to keep hyphenated) or uppercase letters and keep whatever formatting existed previously with a single entry.
    nukleas wrote:
    Also, if whole word is turned on in the given regular text search example, over-size will not be converted to oversize. over-sized would be converted to oversize.
    True, over-size would not be converted to oversize unless over-size was included in the word list.
    False, over-sized would be converted to oversized and not oversize
    Check the spelling in the script >.> (Yes, this is kinda pedantic, I apologize)
    nukleas wrote:
    This is also a concern copy editors have with closing up schoolteacher. In most cases it's fine, until you have a teacher that works at a high school. A high school teacher should probably not be written as high schoolteacher (although I'm sure some of them need to be to deal with some of today's youth.) and that's only really avoidable with a negative lookbehind.
    This can easily be dealt with by adding in the array after the entry of ' school teacher'  , 'schoolteacher'
    'high schoolteacher' , 'high school teacher'
    see script below
    Or in one line:
    grep {findWhat:"(?<![high|elementary|middle] )([S|s]chool) (teacher)"} {changeTo:"$1$2"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    Using the FindChangeReplace, we basically configure the text or grep search each time, so if we want, we can have something like this:
    Makes million/billion/trillion units not break over lines:
    grep     {findWhat:"(\\d+) (mil|bil|tril)(?=lion)"}     {changeTo:"$0",noBreak:true}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    This way we don't need to set about defining tags, since the way the script is written we can just call them when we need them.
    And in this case, wouldn't we be in trouble if the query we wanted has a semicolon or something at the beginning of it? This can be the case in changing delimiters and other things. By defining options outside of the query, we better sanitize the query from errant symbols.
    I think it might be best to also avoid changing things in the first place (like school teacher to schoolteacher and then backtrack with high schoolteacher to high school teacher) and the more exceptions or backtracks we need to make, the more likely errors will make it through.
    Then again, for some, if not most changes that need to be made without exceptions, regular text search is fine. However, there can be a lot more errors introduced without lookaheads or lookbehinds than it could be worth, and this is one of the things that keeps copy editors like me employed
    Also, with the script, why keep Pussy cat if it begins the sentence? The example would be perhaps the Pussy Cat Lounge, in that case you dont want to close that up or change that. However: Pussy cat is another term for a feline. Would not get changed, but it ought to. The script catches school teachers and high school teachers correctly, but not "School teachers are important to our nation" and (correctly) School Teacher's Association. These may need different capitalized versions of each type, or would possibly be better with grep and just brackets with both types alone. Case insensitivity in the grep can also preserve the capitalization of the original text, whereas I believe the text replace would change it to whatever the result is that is provided.
    grep     {findWhat:"([pP]ussy) (cat)"}     {changeTo:"$1"}     {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:true}
    (and the problem with this, that I would have to get to later, is that the plurals need to be dealt with)
    All in all, I don't think it truly matters whether one uses GREP or text for such changes (it's actually best to know both!) and I appreciate you laying out how to perform these searches using javascript, I have definitely learned from it!
    I apologize for any errors, I typed this quite fast D:
    Many thanks Trevor,
    Nukleas

  • Cannot assign an empty string to a parameter with JDBC type VARCHAR

    Hi,
    I am seeing the aforementioned error in the logs. I am guessing its happening whenever I am starting an agent instance in PCo. Can somebody explain whats going on?
    Regards,
    Chanti.
    Heres the complete detail from logs -
    Log Record Details   
    Message: Unable to retreive path for , com.sap.sql.log.OpenSQLException: Failed to set the parameter 1 of the statement >>SELECT ID, PARENTID, FULLPATH, CREATED, CREATEDBY, MODIFIED, MODIFIEDBY, REMOTEPATH, CHECKEDOUTBY FROM XMII_PATHS WHERE FULLPATH =  ?  <<: Cannot assign an empty string to a parameter with JDBC type >>VARCHAR<<.
    Date: 2010-03-12
    Time: 11:32:37:435
    Category: com.sap.xmii.system.FileManager
    Location: com.sap.xmii.system.FileManager
    Application: sap.com/xappsxmiiear

    Sounds like a UI browsing bug (when no path is selected from a catalog tree folder browser) - I would suggest logging a support ticket so that it can be addressed.

Maybe you are looking for

  • Drafts folder relocation Outlook 2013 and Gmail IMAP and multiple saves to trash folder

    Hi, I have Office professional 2013 32 bit running on Win 7 64bit. I have an issue that I know has been discussed but I see no resolution. The drafts are saved on the server not locally and the trash folder fills with multiple copies of the draft, th

  • Trouble connecting Dell monitor to macbook pro

    I'm trying to hook a Dell u3011 to a 2011 macbook pro.  I've got a DisplayPort to MiniDisplayPort cable connected, as well as the USB cable, but the monitor gets no signal and displays a "No Displayport Cable" error message.  I've double-checked the

  • Printing list of drive contents

    How can I print out the list of folders names contained in an external drive? Copy and paste to a file folder won't work, because it wants to copy the contents of all the folders. i just want the list of folders for ID purposes.

  • Nokia 5610 XM MicroSD Card formatted in pc not wor...

    Hi, My 1GB Nokia Micro SD memory card, that came along with Nokia 5610 XM, was corrupted and had no way to fix/remedy/avert the situation unless format the memory. I wasn't able to check if there was indeed a format option in my phone before formatti

  • How can I find where this came from? - start up disk almost full

    Hi, my mac began saying this to me today "Start up disk almost full" So I began deleting files. I deleted a lot via DiskWave. But now Diskwave says I have enough space but my mac sure doesn't. What do I do? What's all that 'other' stuff and where can