Stemming

Hi,
Can someone explain the code in the folloiwng- I need a detailed explanation
class Stemmer
{  private char[] b;
private int i, /* offset into b */
i_end, /* offset to end of stemmed word */
j, k;
private static final int INC = 50;
/* unit of size whereby b is increased */
public Stemmer()
{  b = new char[INC];
i = 0;
i_end = 0;
* Add a character to the word being stemmed. When you are finished
* adding characters, you can call stem(void) to stem the word.
public void add(char ch)
{  if (i == b.length)
{  char[] new_b = new char[i+INC];
for (int c = 0; c < i; c++) new_b[c] = b[c];
b = new_b;
b[i++] = ch;
/** Adds wLen characters to the word being stemmed contained in a portion
* of a char[] array. This is like repeated calls of add(char ch), but
* faster.
public void add(char[] w, int wLen)
{  if (i+wLen >= b.length)
{  char[] new_b = new char[i+wLen+INC];
for (int c = 0; c < i; c++) new_b[c] = b[c];
b = new_b;
for (int c = 0; c < wLen; c++) b[i++] = w[c];
* After a word has been stemmed, it can be retrieved by toString(),
* or a reference to the internal buffer can be retrieved by getResultBuffer
* and getResultLength (which is generally more efficient.)
public String toString() { return new String(b,0,i_end); }
* Returns the length of the word resulting from the stemming process.
public int getResultLength() { return i_end; }
* Returns a reference to a character buffer containing the results of
* the stemming process. You also need to consult getResultLength()
* to determine the length of the result.
public char[] getResultBuffer() { return b; }
/* cons(i) is true <=> b[i] is a consonant. */
private final boolean cons(int i)
{  switch (b[i])
{  case 'a': case 'e': case 'i': case 'o': case 'u': return false;
case 'y': return (i==0) ? true : !cons(i-1);
default: return true;
/* m() measures the number of consonant sequences between 0 and j. if c is
a consonant sequence and v a vowel sequence, and <..> indicates arbitrary
presence,
<c><v> gives 0
<c>vc<v> gives 1
<c>vcvc<v> gives 2
<c>vcvcvc<v> gives 3
private final int m()
{  int n = 0;
int i = 0;
while(true)
{  if (i > j) return n;
if (! cons(i)) break; i++;
i++;
while(true)
{  while(true)
{  if (i > j) return n;
if (cons(i)) break;
i++;
i++;
n++;
while(true)
{  if (i > j) return n;
if (! cons(i)) break;
i++;
i++;
/* vowelinstem() is true <=> 0,...j contains a vowel */
private final boolean vowelinstem()
{  int i; for (i = 0; i <= j; i++) if (! cons(i)) return true;
return false;
/* doublec(j) is true <=> j,(j-1) contain a double consonant. */
private final boolean doublec(int j)
{  if (j < 1) return false;
if (b[j] != b[j-1]) return false;
return cons(j);
/* cvc(i) is true <=> i-2,i-1,i has the form consonant - vowel - consonant
and also if the second c is not w,x or y. this is used when trying to
restore an e at the end of a short word. e.g.
cav(e), lov(e), hop(e), crim(e), but
snow, box, tray.
private final boolean cvc(int i)
{  if (i < 2 || !cons(i) || cons(i-1) || !cons(i-2)) return false;
{  int ch = b[i];
if (ch == 'w' || ch == 'x' || ch == 'y') return false;
return true;
private final boolean ends(String s)
{  int l = s.length();
int o = k-l+1;
if (o < 0) return false;
for (int i = 0; i < l; i++) if (b[o+i] != s.charAt(i)) return false;
j = k-l;
return true;
/* setto(s) sets (j+1),...k to the characters in the string s, readjusting
k. */
private final void setto(String s)
{  int l = s.length();
int o = j+1;
for (int i = 0; i < l; i++) b[o+i] = s.charAt(i);
k = j+l;
}

Use code tags when posting code.
I would suggest and some println()s and then running the code.

Similar Messages

  • Wav file from remix stem pack has no volume - Logic Pro 9

    I recently downloaded a remix stem pack and can't get the vocal wav file to play. It show's a wave form, but no volume. If I load a sample wav file, a drum hit for example, it will play no problem. Anyone have any idea's? It's not the wav file as it plays in itunes, and also plays in my friends logic pro.
    Thanks

    The hierarchy is [LOGIC FILE NAME]>LgDoc>(files ... Displaystate, DocumentData, Windowimage.jpg)
    Like this:
    You need to recreate the folder structure in order to be able to open the file.  (look at the path bar at the bottom of the picture.)
    Do not disassociate the displaystate from the documentData files.  They should be together.  The windowimage file is optional and will be recreated when the file is saved again.
    Hope this helps!

  • Auto_lexer (stemming) not working for other languages(other than english)

    Hi All,
    We are planning to use AUTO_LEXER instead of MULTI_LEXER and observed that stemming is not working for German where as it is working for English when I use AUTO_LEXER. I even used query templates but of no use.
    But when i use MULTI_LEXER, creating sub lexers for German and Enlgish, Stemming is working for German also after changing the session language and setting stemmer of wod list to German (Which is expected).
    Following is the code for AUTO_LEXER creation:
    CREATE TABLE test_auto_lexer(pkey NUMBER(5,0),
    lang_index VARCHAR2(3),
    content_text CLOB,
    CONSTRAINT test_auto_lexer_pk primary key (pkey))
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (1,'eng','I drive a bike')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (2,'eng','I drove a bike')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (3,'eng','I have driven a bike')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (4,'eng','Just check for other things')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (5,'eng','always drive a car')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (6,'eng','it is nothing')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (7,'ger','Ich fahre ein Fahrrad')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (8,'ger','Ich fuhr ein Fahrrad')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (9,'ger','Ich habe ein Fahrrad gefahren')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (10,'ger','Aktivieren Sie einfach für andere Dinge')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (11,'ger','immer Auto fahren')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (12,'ger','es ist nichts')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (13,'ger','sprechen')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (14,'ger','sprach')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (15,'ger','gesprochen')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (16,'ger','tale')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (17,'ger','Indlæg')
    INSERT INTO test_auto_lexer(pkey,lang_index,content_text)
    VALUES (18,'ger','tales')
    BEGIN
    ctx_ddl.create_preference('auto_lexer1', 'auto_lexer');
    END;
    BEGIN
    ctx_ddl.set_attribute('auto_lexer1','index_stems','yes');
    END;
    BEGIN
    ctx_ddl.set_attribute('auto_lexer1','language','danish english german');
    END;
    BEGIN
    ctx_ddl.set_attribute('auto_lexer1','alternate_spelling','german');
    END;
    CREATE INDEX test_auto_lexer_ix1
    ON test_auto_lexer(content_text)
    INDEXTYPE IS ctxsys.context
    PARAMETERS ('datastore ctxsys.direct_datastore filter ctxsys.null_filter lexer auto_lexer1')
    select to_char(content_Text) from test_auto_lexer where contains(content_text,
    '<query>
    <textquery lang="ger" grammar="context">
    $fahren
    </textquery>
    <score datatype="integer"/>
    </query>') > 0
    this doesnt work even after changing the session language. My default Sesson language is AMERICAN.
    Could any one help me with this, in case I am missing something here. I would be really thankful.
    Edited by: Nagendra Prasad on Jan 23, 2010 12:05 AM

    In the future, please begin a new thread for a new question and provide a link to a related question.
    According to the online documentation, Oracle only supports stemming for English, Dutch, French, German, Italian, Spanish, and Japanese. Oracle does not support Russian stemming, although you may have gotten some accidental results, due to identifying it as a different language and applying stemming rules for that language. The following manual sections show the languages available for the index_stems attribute of the basic_lexer and stemmer attribute of the basic_wordlist:
    Basic_lexer attributes:
    http://docs.oracle.com/cd/E11882_01/text.112/e24436/cdatadic.htm#CIHHBAAD
    Basic_wordlist attributes:
    http://docs.oracle.com/cd/E11882_01/text.112/e24436/cdatadic.htm#g1019326
    Also, please see the following note:
    Features not available in 11.2.0.3:
    http://docs.oracle.com/cd/E11882_01/readmes.112/e22488/toc.htm#BABDGGDB
    "Certain Oracle Text functionality based on third-party technologies, including AUTO_LEXER and CTX_ENTITY, have been disabled in this release (reference Bug 12618046). For BASIC_LEXER, the usage of the INDEX_STEMS attribute values that depend on third-party technologies, is also affected. If this impacts an existing application, contact Oracle Support Services for guidance."
    Also, the auto_lexer has been replaced by the world_lexer, which only has one attribute:
    http://docs.oracle.com/cd/E11882_01/text.112/e24436/cdatadic.htm#BHCJEGFJ
    I don't work for Oracle, so I don't know why they do things the way they do.
    So, you need to stick with the basic_wordlist for stemming, not the lexers. However, you may get better performance by combining the multi_lexer with the basic_wordlist, as the multi_lexer eliminates time spent on automatic language detection. But, you need to remember not to use the index_stems with your lexer, since it will conflict with the wordlist. I am not experiencing any time problems as you have. Please see the demo below. I have provided the whole script below that, so that you can reproduce it on your system. If you still have problems, then it may be due to differences in versions.
    -- demo:
    SCOTT@orcl_11gR2> select * from v$version
      2  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl_11gR2> select value from v$nls_parameters
      2  where  parameter = 'NLS_CHARACTERSET'
      3  /
    VALUE
    AL32UTF8
    1 row selected.
    SCOTT@orcl_11gR2> DROP TABLE news
      2  /
    Table dropped.
    SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('my_wordlist')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('global_lexer')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('english_LEXER')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> EXEC CTX_DDL.DROP_PREFERENCE ('german_LEXER')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> CREATE TABLE news
      2    (pkey            NUMBER,
      3       lang            VARCHAR2 (2),
      4       short_content  CLOB)
      5  /
    Table created.
    SCOTT@orcl_11gR2> INSERT ALL
      2  INTO news (pkey, lang, short_content)
      3    VALUES  (1, 'en', 'I drive a bike.')
      4  INTO news (pkey, lang, short_content)
      5    VALUES  (2, 'en', 'I drove a bike.')
      6  INTO news (pkey, lang, short_content)
      7    VALUES  (3, 'en', 'I have driven a bike.')
      8  INTO news (pkey, lang, short_content)
      9    VALUES  (4, 'en', 'I always drive a car')
    10  INTO news (pkey, lang, short_content)
    11    VALUES  (5, 'en', 'This is nothing')
    12  INTO news (pkey, lang, short_content)
    13    VALUES  (6, 'de', 'Ich fahre ein Fahrrad.')
    14  INTO news (pkey, lang, short_content)
    15    VALUES  (7, 'de', 'Ich fuhr ein Fahrrad.')
    16  INTO news (pkey, lang, short_content)
    17    VALUES  (8, 'de', 'Ich habe ein Fahrrad gefahren.')
    18  INTO news (pkey, lang, short_content)
    19    VALUES  (9, 'de', 'Ich habe immer ein Auto fahren.')
    20  INTO news (pkey, lang, short_content)
    21    VALUES  (10, 'de', 'Es ist nichts.')
    22  SELECT * FROM DUAL
    23  /
    10 rows created.
    SCOTT@orcl_11gR2> BEGIN
      2    -- word list:
      3    ctx_ddl.create_preference ('my_wordlist',   'basic_wordlist');
      4    ctx_ddl.set_attribute      ('my_wordlist',   'stemmer',           'auto');
      5    -- english lexer:
      6    ctx_ddl.create_preference ('english_lexer', 'basic_lexer');
      7    -- german lexer:
      8    ctx_ddl.create_preference ('german_lexer',  'basic_lexer');
      9    ctx_ddl.set_attribute      ('german_lexer',  'composite',       'german');
    10    ctx_ddl.set_attribute      ('german_lexer',  'alternate_spelling', 'german');
    11    ctx_ddl.set_attribute      ('german_lexer',  'mixed_case',       'no');
    12    ctx_ddl.set_attribute      ('german_lexer',  'base_letter',       'yes');
    13    -- multi_lexer:
    14    ctx_ddl.create_preference ('global_lexer',  'multi_lexer');
    15    ctx_ddl.add_sub_lexer      ('global_lexer',  'default',            'english_lexer');
    16    ctx_ddl.add_sub_lexer      ('global_lexer',  'german',            'german_lexer');
    17  END;
    18  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create index search_news
      2  on news (short_content)
      3  indextype is ctxsys.context
      4  parameters
      5    ('lexer            global_lexer
      6        language column  lang
      7        wordlist       my_wordlist')
      8  /
    Index created.
    SCOTT@orcl_11gR2> EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'NEWS')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> COLUMN short_content FORMAT A30
    SCOTT@orcl_11gR2> ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN'
      2  /
    Session altered.
    SCOTT@orcl_11gR2> set timing on
    SCOTT@orcl_11gR2> select * from news
      2  where  contains (short_content, '$drive') > 0
      3  /
          PKEY LA SHORT_CONTENT
             1 en I drive a bike.
             2 en I drove a bike.
             3 en I have driven a bike.
             4 en I always drive a car
    4 rows selected.
    Elapsed: 00:00:00.05
    SCOTT@orcl_11gR2> select * from news
      2  where  contains (short_content, '$drove') > 0
      3  /
          PKEY LA SHORT_CONTENT
             1 en I drive a bike.
             2 en I drove a bike.
             3 en I have driven a bike.
             4 en I always drive a car
    4 rows selected.
    Elapsed: 00:00:00.05
    SCOTT@orcl_11gR2> ALTER SESSION SET NLS_LANGUAGE = 'GERMAN'
      2  /
    Session altered.
    Elapsed: 00:00:00.01
    SCOTT@orcl_11gR2> select * from news
      2  where  contains (short_content, '$fahr') > 0
      3  /
          PKEY LA SHORT_CONTENT
             6 de Ich fahre ein Fahrrad.
             7 de Ich fuhr ein Fahrrad.
             8 de Ich habe ein Fahrrad gefahren.
             9 de Ich habe immer ein Auto fahren
    4 rows selected.
    Elapsed: 00:00:00.07
    SCOTT@orcl_11gR2> select * from news
      2  where  contains (short_content, '$fuhr') > 0
      3  /
          PKEY LA SHORT_CONTENT
             6 de Ich fahre ein Fahrrad.
             7 de Ich fuhr ein Fahrrad.
             8 de Ich habe ein Fahrrad gefahren.
             9 de Ich habe immer ein Auto fahren
    4 rows selected.
    Elapsed: 00:00:00.16-- script for you to reproduce the demo on your system:
    select * from v$version
    select value from v$nls_parameters
    where  parameter = 'NLS_CHARACTERSET'
    DROP TABLE news
    EXEC CTX_DDL.DROP_PREFERENCE ('my_wordlist')
    EXEC CTX_DDL.DROP_PREFERENCE ('global_lexer')
    EXEC CTX_DDL.DROP_PREFERENCE ('english_LEXER')
    EXEC CTX_DDL.DROP_PREFERENCE ('german_LEXER')
    CREATE TABLE news
      (pkey           NUMBER,
       lang           VARCHAR2 (2),
       short_content  CLOB)
    INSERT ALL
    INTO news (pkey, lang, short_content)
      VALUES  (1, 'en', 'I drive a bike.')
    INTO news (pkey, lang, short_content)
      VALUES  (2, 'en', 'I drove a bike.')
    INTO news (pkey, lang, short_content)
      VALUES  (3, 'en', 'I have driven a bike.')
    INTO news (pkey, lang, short_content)
      VALUES  (4, 'en', 'I always drive a car')
    INTO news (pkey, lang, short_content)
      VALUES  (5, 'en', 'This is nothing')
    INTO news (pkey, lang, short_content)
      VALUES  (6, 'de', 'Ich fahre ein Fahrrad.')
    INTO news (pkey, lang, short_content)
      VALUES  (7, 'de', 'Ich fuhr ein Fahrrad.')
    INTO news (pkey, lang, short_content)
      VALUES  (8, 'de', 'Ich habe ein Fahrrad gefahren.')
    INTO news (pkey, lang, short_content)
      VALUES  (9, 'de', 'Ich habe immer ein Auto fahren.')
    INTO news (pkey, lang, short_content)
      VALUES  (10, 'de', 'Es ist nichts.')
    SELECT * FROM DUAL
    BEGIN
      -- word list:
      ctx_ddl.create_preference ('my_wordlist',   'basic_wordlist');
      ctx_ddl.set_attribute     ('my_wordlist',   'stemmer',            'auto');
      -- english lexer:
      ctx_ddl.create_preference ('english_lexer', 'basic_lexer');
      -- german lexer:
      ctx_ddl.create_preference ('german_lexer',  'basic_lexer');
      ctx_ddl.set_attribute     ('german_lexer',  'composite',          'german');
      ctx_ddl.set_attribute     ('german_lexer',  'alternate_spelling', 'german');
      ctx_ddl.set_attribute     ('german_lexer',  'mixed_case',          'no');
      ctx_ddl.set_attribute     ('german_lexer',  'base_letter',         'yes');
      -- multi_lexer:
      ctx_ddl.create_preference ('global_lexer',  'multi_lexer');
      ctx_ddl.add_sub_lexer     ('global_lexer',  'default',             'english_lexer');
      ctx_ddl.add_sub_lexer     ('global_lexer',  'german',              'german_lexer');
    END;
    create index search_news
    on news (short_content)
    indextype is ctxsys.context
    parameters
      ('lexer            global_lexer
        language column  lang
        wordlist         my_wordlist')
    EXEC DBMS_STATS.GATHER_TABLE_STATS (USER, 'NEWS')
    COLUMN short_content FORMAT A30
    ALTER SESSION SET NLS_LANGUAGE = 'AMERICAN'
    set timing on
    select * from news
    where  contains (short_content, '$drive') > 0
    select * from news
    where  contains (short_content, '$drove') > 0
    ALTER SESSION SET NLS_LANGUAGE = 'GERMAN'
    select * from news
    where  contains (short_content, '$fahr') > 0
    select * from news
    where  contains (short_content, '$fuhr') > 0
    /

  • Advice on how to access photos on an iPad that were synced from a now failed laptop? The question stems from a need to return my current iPad having just taken delivery of a new unit. Thanks

    I am after some advice on how to access photos on an iPad that were synced from a now failed laptop? The question stems from a need to return my current iPad having just taken delivery of a new unit. Thanks

    If you have a dropbox account, there's a free app (probably more) that syncs photos to your dropbox account - picbox. 
    There's also PhotoSync that syncs photos to/from a number of different services and devices.

  • How to get the position of the stem in control valve using slider control in the front panel

    I have created a calibration program for a control valve. Signal (4-20mA) is generated from labview using slider contorl which is given to the valve via DAQ(module 9265) and again the feedback signal from the valve is acquired using DAQ(module 9203).. . There is an input ISO/ISC(Increasing signal to open/ Increasing signal to close) in the front panel.
    ISO would set the output to increase from (4-20)mA further opening the valve
    ISC would set the output to increase from (4-20)mA further closing the valve
    I have doubt, how can i get the position of a stem

    Ravens Fan wrote:
    If the position of the stem is being sent to the PC through a 4-20 mA signal into your DAQ 9203 module, then you just need to do an analog input read in order to get the signal.
    When reading this post, that is what came to mind...  So let's see if both RavensFan & I are trying to understand the same thing...  Are you saying that the position of the stem is linear (or scaled) to the amount of current sent to it?  Meaning a 4mA signal would move it a certain distance, and 10mA would move another given / known distance?  Or are you saying that it is calibrated so that a 20mA signal for a certain duration (ms) would move it a given distance? So the scale would be time and not current unless a lookup table is used to adjust the time duration based on the current being drawn...
    It's just that I am not familiar with solenoid / drive devices that related to current..  To voltage, yes.  To time, yes..  To current, I'm simply saying that I am not familiar with that.  Can you tell us more about this stem (mfg / model designation)?

  • Duplicate file name suddenly appearing in audio stems

    I have a FCP project that I've been working in that includes sequences with Dialogue, SFX and Music audio stems cut in (as .wav files). The Dialogue stem is mono and is not affected by this issue. The SFX and Music stems were imported as SFX L, SFX R, Music L, Music R. After lining everything up, I panned the SFX and Music stems and stereo paired in FCP to keep the tracks together and in sync while we made additional picture changes.
    Months have passed working in these sequences and I have just noticed that the Stereo SFX and Music stems in my current sequence all seem to suddenly have the same name. In other words, SFX L and SFX R both display SFX R in the sequence and Music L and Music R both display Music R as their file name in the sequence. Isolating each track and playing back confirms that the SFX L and Music L are still being referenced... FCP has just decided to call them SFX R and Music R instead.
    Has anyone else had this experience? It seems to be some sort of corruption in the metadata or something. I ran a quick Audio EDL and everything looks correct... SFX L and Music L do come up. If I turn off stereo pairing and go to the item properties for these tracks, FCP will let me rename the file name to be correct again. Does anyone think this is worth doing? I don't want to end up with a corrupt project.
    We have been duplicating sequences and copy/pasting video and audio to/from different timelines. Perhaps this is how this issue started... I have other reels in this show that this hasn't happened to.
    Thanks for any advice!

    It's probably faster and better to perform a match frame of the files in question, and re edit them over themselves. Just to refresh the names and references.
    Jerry

  • How to create index - Fuzzy Matching and Stemming

    Hi,
    I have a problem with creating and index for fuzzy matching and stemming with my expect behavious
    I Have table customer and column sortname. This table ussally contains values in format: "Surname, FirstName"
    "Lenox, Carl"
    "Svensson, Max"
    "Hamlberg, Ulf"
    etc...
    1. Previously I have index created like this:
    CREATE INDEX IX_CUST_TMP_CTXSORTNAME ON CUSTOMER (SORTNAME) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('SYNC(ON COMMIT)');
    If I run:
    select * from CUSTOMER where contains(sortname,'Hamlberg') > 0; -- "Hamlberg, Ulf" is returned - OK
    select * from CUSTOMER where contains(sortname,'Ulf') > 0; -- "Hamlberg, Ulf" is returned - OK
    2. I drop the index and create new one for fuzzy matching and stemming
    --NOTE: something is commented out, but I try to run pretty much all the possible varations 
    exec ctx_ddl.create_preference('MYYY_SWEDISH_LEXER', 'BASIC_LEXER');
    --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'printjoins', '_-');
    --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'skipjoins', ',');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_themes', 'NO');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_text', 'YES');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_stems', 'SWEDISH');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'alternate_spelling', 'SWEDISH');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'base_letter', 'YES');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'base_letter_type', 'GENERIC');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'override_base_letter', 'TRUE');
    --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'whitespace', ',');
    exec ctx_ddl.create_preference('MYYY_SWEDISH_FUZZY_PREF', 'BASIC_WORDLIST');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_MATCH','AUTO');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_SCORE','60');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_NUMRESULTS','100');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
    exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','STEMMER','AUTO');
    create index IX_CUST_TMP_CTXSORTNAME on CUSTOMER (sortname) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('LEXER MYYY_SWEDISH_LEXER Wordlist MYYY_SWEDISH_FUZZY_PREF SYNC(ON COMMIT)');
    If I run:
    select * from CUSTOMER where contains(sortname,'Hamlberg') > 0; -- "Hamlberg, Ulf" is returned - OK
    select * from CUSTOMER where contains(sortname,'Ulf') > 0; -- "Hamlberg, Ulf" is returned - NOT OK - Why it is not returned ??
    3. Then I want to use fuzzy for searching names:
    a. SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg}, 50, 10, weight)',1) > 0; - it should return "Hamlberg, Ulf"
    b. SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Ulf}, 50, 10, weight)',1) > 0; - it should return "Hamlberg, Ulf"
    c. SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg Ulf}, 50, 10, weight)',1) > 0; - it should return "Hamlberg, Ulf"
    d. SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg, Ulf}, 50, 10, weight)',1) > 0; - it should return "Hamlberg, Ulf"
    Is it possible to do that somehow ?
    Thx for answers.
    Edited by: 906314 on 7.3.2012 4:01

    It works fine for me:
    SQL> create table customer (sortname varchar2(40));
    Table created.
    SQL> insert into customer values ('Lenox, Carl');
    1 row created.
    SQL> insert into customer values ('Svensson, Max');
    1 row created.
    SQL> insert into customer values ('Hamlberg, Ulf');
    1 row created.
    SQL> exec ctx_ddl.create_preference('MYYY_SWEDISH_LEXER', 'BASIC_LEXER');
    PL/SQL procedure successfully completed.
    SQL> --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'printjoins', '_-');
    SQL> --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'skipjoins', ',');
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_themes', 'NO');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_text', 'YES');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'index_stems', 'SWEDISH');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'alternate_spelling', 'SWEDISH');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'base_letter', 'YES');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'base_letter_type', 'GENERIC');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'override_base_letter', 'TRUE');
    PL/SQL procedure successfully completed.
    SQL> --exec ctx_ddl.set_attribute('MYYY_SWEDISH_LEXER', 'whitespace', ',');
    SQL>
    SQL> exec ctx_ddl.create_preference('MYYY_SWEDISH_FUZZY_PREF', 'BASIC_WORDLIST');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_MATCH','AUTO');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_SCORE','60');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','FUZZY_NUMRESULTS','100');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('MYYY_SWEDISH_FUZZY_PREF','STEMMER','AUTO');
    PL/SQL procedure successfully completed.
    SQL>
    SQL> create index IX_CUST_TMP_CTXSORTNAME on CUSTOMER (sortname) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS ('LEXER MYYY_SWEDISH_LEXER Wordlist
    MYYY_SWEDISH_FUZZY_PREF SYNC(ON COMMIT)');
    Index created.
    SQL> select * from CUSTOMER where contains(sortname,'Hamlberg') > 0;
    SORTNAME
    Hamlberg, Ulf
    SQL> select * from CUSTOMER where contains(sortname,'Ulf') > 0;
    SORTNAME
    Hamlberg, Ulf
    SQL> SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg}, 50, 10, weight)',1) > 0;
      SCORE(1) SORTNAME
            44 Hamlberg, Ulf
    SQL> SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Ulf}, 50, 10, weight)',1) > 0;
      SCORE(1) SORTNAME
            44 Hamlberg, Ulf
    SQL> SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg Ulf}, 50, 10, weight)',1) > 0;
      SCORE(1) SORTNAME
            44 Hamlberg, Ulf
    SQL> SELECT score(1), sortname FROM CUSTOMER where CONTAINS(sortname, 'fuzzy({Hamlberg, Ulf}, 50, 10, weight)',1) > 0;
      SCORE(1) SORTNAME
            44 Hamlberg, UlfIs this different from what you see? If so, please show a complete session (as I have) so we can check you're not doing anything wrong.
    I don't understand your:
    select * from CUSTOMER where contains(sortname,'Ulf') > 0; -- "Hamlberg, Ulf" is returned - NOT OK - Why it is not returned ??
    Do you mean "why is it returned?" It's because the "contains" operator matches any word in the original text. That's the whole point of it.

  • Is it possible to use a multi-colored image (red tomato with green stem) as a rollover indicator for button selection for a DVD in encore

    Have 6 Buttons and would like to use a red tomato with a green stem to indicate that button is being rolled over and selected?

    Short answer - No. Two long answers - yes and yes.
    Highlights can be only single color (two bit indexed color) and your image is not.
    However, you can have up to 3 highlights using different colors for each one. So edit your image so you overlay 3 different colors (in photoshop layers, =1, =2, and =3). I would probably try the bottom layer as the red ball; then the white reflection, and then the green on top. When the highlight is active, all 3 colors show.
    The other method is to use autoactivate (on a button) to go to a different menu that changes the image in the background for that button.  You create multiple menus, with an ordinary state for all buttons in all menus, except for the "highlight" different for the "selected" button. Mouseover won't autoactivate, so this doesn't work on a  computer the way you'd like.

  • Whats the best way to print stems?

    I need to make stems to import into pro tools. Say I have 10 stereo tracks with inserts and aux sends and basically a whole mix. I want to print stems so I can import the mix into pro tools and work on it at another studio. In pro tools I could route things to stereo busses and then make stereo tracks with the inputs set to those busses. I can figure out how to make the output of a channel a stereo bus. Is that possible?

    It's easy. I have been doing this for a while now. Just solo the track(s) you need to Bounce. What I do to make it fool proof at the Pro tools end is: Set the Locators to the full length of your song. say bar 1 to whatever 70. Easily done by just dragging the cycle in the Bar line the full length of the song. Then hit the Bounce button. Then check your settings. Check the locator settings as well in the Bounce window. I set my audio settings to 24 bit 48 Khz wave file. Then hit bounce and you're away. Repeat the same procedure for all the individual tracks or leave all tracks on soloed to do the full mix. I do my bouncing offline and make sure Normalize is not ticked. Good luck.

  • Count of tokens using group by + SYN operator + Spell Checking + Stemming

    Hi,
    I have a text data on which i have created context index and populated the tokens table using "CTX_DOC.TOKENS" procedure.
    Now i want to find the number of occurences of tokens using count and group by function.
    I am using the foll query on table "INSP_INS_IDX_TOK"
    select token ,count(token)
    from INSP_INS_IDX_TOK
    group by token
    order By 2 desc
    Token count(Token)
    WORK     84
    WORKING     24
    TAKING     14
    TAKE     13
    now i want to use the synonym operator, stemming operator and spelling check to be implemented while finding the count of tokens so that, it would give more insights.
    o/p should be like
    Token count(Token)
    WORK     108
    TAKE     27
    Please suggest me some inputs on the same.
    Thanks in Advance.

    put it in a table, create context index and then query....
    --- As oracle text can be used.
    On the different note, try to create a context index and look at the $I table of that index. You may find something relevant.

  • Using stem operator ($) in select

    hi
    it's possible to use the stem operator in queries others than those using contains? this will be useful to find thelist of word without executing a search for the text indexed

    The stem ($) operator is a Intermedia Text/Oracle Text feature, so you have to use contains.
    Thomas

  • Facing memory error during shifting from 3d stem graph to 3d surface graph in labview 2010

    hello all,
    earlier I was using 3D Stem graph in labview 2010. Now we want to move to Surface plot for same data.when i am trying surface graph it shows memory error.
    I have  10240 data.
    I was using vector method in stem graph so now for Surface graph i have thought that i have to make matrics of 10240x10240 and its diagonal elements should be my Z co0ordiants.
    plz help me out here.
    thanks & regards, 

    hello mikeporter,
    thanks for reply.I am attaching my Vi. It has some error also.plz look into it.
    X and Y are my co-ordinates pairs.I will be having values for these and have to update for same.
    Attachments:
    Untitled 2_surface.vi ‏184 KB

  • Best way to handle duplicate headings stemming from linked TOC book?

    What's the best way to handle duplicate topic titles stemming from TOC books that contain links to a topic that you want to have appear in the body? The problem I've had for years now is that the TOC generates one heading, and the topic itself generates one heading.This results in duplicate headings in the printed output.
    I have a large ~2500 topic project I have to print every release, and to date we've been handling it in post-build word macros, but it's not 100% effective, so we're looking to fix this issue on the source side of the fence. On some of our smaller projects, we've actually marked with the heading in the topic itself with the Online CBT and that seems to work. We're thinking of doing the same to our huge project unless there's a better way of handling this. Any suggestions?

    See the tip immediately above this link. http://www.grainge.org/pages/authoring/printing/rh9_printing.htm#wizard_page3
    The alternative is to remove the topic from the print layout so that it only generates by virtue of its link to the book.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Significance of enabling stemming while creating lexer + oracle text

    Hi all,
    I am creating a basic lexer with stemming enabled.
    begin
    ctx_ddl.create_preference('mylexer', 'basic_lexer');
    ctx_ddl.set_attribute('mylexer', 'index_stems', 'ENGLISH');
    end;
    when i create context index on clob column, default 4 tables get created, one among them, ie., "dr$<index_name>$i", will have a column token_type with 9 has a root words.
    Where else this 'index_stems' is getting used?
    are we using anywhere else ?
    I just want to know the purpose of enabling stemming.
    Please help me in understanding the purpose.
    Thanks in Advance.

    Purpose of stemming:
    Stemming enables you to match words with the same linguistic root.
    Suppose indexed column contains words like speak,spoke and spoken.
    If stemming is enable for english then search on speak should give you the records containing all the three results.
    We can enable stemming for a specific language using the word list preference.
    We can find regarding the word list in Oracle Documentation (b14217 in case of 10g).
    Hope this helps.

  • Generate stem list

    Hi,
    How to generate a list of the available stems in a field or a parial list (for example the stems in a field which begin with "a" or "te") ?
    Zsolt

    Hi,
    I have just added an example of yvindevogel suggestion to my blog, http://adobelivecycledesignercookbookbybr001.blogspot.com.au/2014/01/listing-all-fields-in -form.html
    This uses an XSLT and there are a few steps but you will end up with a list of fields in Microsoft Excel, with the captions, error messages, display patterns, fonts, bindings, etc listed.
    You should be able to cusomise it to suit you needs.
    Regards
    Bruce

  • 3D Stem Graph String-based Axes

    When using 3D Stem Plots and real-world data, I successfully generate a 3D Graph. However, I was wondering if it is possible to customize the X and Y axis values with strings rather than numbers. I still want the Z-Axis to be a numerical intensity, but rather than having the X and Y values be an integer that I have to define in a note, I would like to make these values show strings.
    My VI (attached) involves sample baseball batting/running statistics for each position (except pitcher).
    Thanks in advanced,
    T16626
    "Whether you think you can or can't, you're right."
    ~Henry Ford
    Solved!
    Go to Solution.
    Attachments:
    STATS_for-3D-data_CHOOSE-THIS-ONE.csv ‏1 KB
    SQUIRES_real-life-3d-data.vi ‏17 KB

    Thanks Shane, but this isn't exactly what I was asking. Maybe I convoluted my question.
    Imagine a 2 dimensional vertical bar graph.
    The Y-Axis shows intensity, while the X-Axis is marked with what each bar refers to.
    So let's say we're looking at a pizza parlor. They graph how many cheese, pepperoni, and sausage pizzas are sold on average per week.
    Cheese---25 per week
    Pepperoni---20 per week
    Sausage---18 per week
    so the X-Axis would have 3 tick marks, one designating each bar (cheese, pepperoni, and sausage) and the Y-Axis would be marked from 0 to 25, and the bars would reach 25, 20, and 18 units high respectively.
    Here's a visualization of an ideal X-Axis (from Wikipedia's page "Bar Chart"): http://upload.wikimedia.org/wikipedia/commons/3/35/Incarceration_Rates_Worldwide_ZP.svg
    What I am looking to do is find a way to create these custom ticks on the X-Axis instead of writing off to the side:
    "1 refers to cheese, 2 refers to pepperoni, and 3 refers to sausage"
    Please note that my goal is to apply this concept to a 3-D graph, rather than a 2-D graph.
    Hope this clarifies my question.
    ~T16626
    "Whether you think you can or can't, you're right."
    ~Henry Ford

Maybe you are looking for

  • 2 OAS on the same server

    we have installed a OAS 10.1.3.0 on Linux. is it posble to install OAS 10.1.3.3 on the same server, is there any confliction? if it posible, how can I change the port number for the 2nd OAS? or will it detect the port have been used and choose diffre

  • ISCSI-to-FC routing in Cisco MDS 9000 Family

    Hi, I'm puzzled about support for iSCSI-to-FC routing in the MDS 9000 family. Earlier hardware such as the 9216i switch and the MPS-14/2 module had a feature to allow an iSCSI Initiator to connect transparently to an FC target. This equipment is now

  • Photo Streaming WILL NO WORK ON I PHOTO!

    Photo Streaming will work on all my IOS devices, BUT not in I Photo on my MAC. I have the latest I photo and photo streaming is on.

  • Problem with restriction specifier in C++ AMP code

    Hi, I'm using C++ AMP (I'm not that experienced with C++ and I'm new to AMP, so I have to stumble through this stuff) But I thought I had this code working, but now I'm getting the following error: Error    1    error C3930: 'WRC_Raytracer::Raytracer

  • Randomness when waking up from standby

    I have set up so that the 520 goes into standby after one hour of inactivity.  Closing the lid is set up to do nothing.  Sometimes when opening the lid when in stanby it goes straight to the login screen, sometimes I have to press the power button to