From: Lars H. <he...@se...> - 2006-03-21 16:36:33
|
Hi, Code was wrong, here a slightly modified version. --- // Put this in one line static final String TM_LANG = \\ "http://www.topicmaps.org/xtm/1.0/language.xtm"; Locale locale = Locale.getDefault(); // Note that the ISO 639 is not stable String preferredLang = locale.getLanguage().equals("de") ? "de" : "en"; // Used to create the subject identifier String langRef = TM_LANG + preferredLang; // Subject identifier Locator langLoc = topicMap.getBaseLocator().resolveRelative(langRef); // Fetch topic by the subject identifier Topic langTopic = topicMap.getTopicBySubjectIndicator(langLoc); if (langTopic == null) { langTopic = topicMap.createTopic(); langTopic.addSubjectIndicator(langLoc); } nameExtractor.addPreferredTheme(langTopic); --- Best regards, Lars -- http://semagia.com http://topicgarden.com/mailinglist/ German Topic Maps mailinglist |