mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Next stage of multi lingual searches
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4609 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -13,30 +13,144 @@ public enum MLAnalysisMode
|
||||
/**
|
||||
* Only exact locale is used.
|
||||
*/
|
||||
LOCALE_ONLY,
|
||||
LOCALE_ONLY
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Only the exact locale and no local === all lnaguages
|
||||
*/
|
||||
LOCALE_AND_ALL,
|
||||
LOCALE_AND_ALL
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Expand the locale to include all the locales that contain it.
|
||||
* en_GB would be en_GB, en, but not all languages
|
||||
*/
|
||||
LOCALE_AND_ALL_CONTAINING_LOCALES,
|
||||
LOCALE_AND_ALL_CONTAINING_LOCALES
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Expand the locale to include all the locales that contain it.
|
||||
* en_GB would be en_GB, en, and all.
|
||||
*/
|
||||
LOCALE_AND_ALL_CONTAINING_LOCALES_AND_ALL,
|
||||
LOCALE_AND_ALL_CONTAINING_LOCALES_AND_ALL
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Expand to all the locales that are contained by this.
|
||||
* en would expand to en, en_GB, en_US, ....
|
||||
*/
|
||||
LOCAL_AND_ALL_CONTAINED_LOCALES;
|
||||
LOCALE_AND_ALL_CONTAINED_LOCALES
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* No prefix only
|
||||
*/
|
||||
ALL_ONLY
|
||||
{
|
||||
public boolean includesAll()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
public boolean includesContained()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesContaining()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean includesExact()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
public static MLAnalysisMode getMLAnalysisMode(String mode)
|
||||
{
|
||||
@@ -49,4 +163,13 @@ public enum MLAnalysisMode
|
||||
}
|
||||
throw new AlfrescoRuntimeException("Unknown ML Analysis mode "+mode);
|
||||
}
|
||||
|
||||
public abstract boolean includesAll();
|
||||
|
||||
public abstract boolean includesContained();
|
||||
|
||||
public abstract boolean includesContaining();
|
||||
|
||||
public abstract boolean includesExact();
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user