Prepare nameparser Constants.

    Remove nameparser's titles and use our own and add as suffixes the roman numerals.
    Configuration is the same for all names (i.e. instances).
3047
def _prepare_nameparser_constants():
    
    constants = Constants()
    roman_numeral_suffixes = [u'v', u'vi', u'vii', u'viii', u'ix', u'x',
                              u'xii', u'xiii', u'xiv', u'xv']
    titles = [u'Dr', u'Prof', u'Professor', u'Sir', u'Editor', u'Ed', u'Mr',
              u'Mrs', u'Ms', u'Chair', u'Co-Chair', u'Chairs', u'co-Chairs']
    constants.titles.remove(*constants.titles).add(*titles)
    constants.suffix_not_acronyms.add(*roman_numeral_suffixes)
    return constants
969247
def with_suffix(self, suffix):
        
        # XXX if suffix is None, should the current suffix be removed?
        f = self._flavour
        if f.sep in suffix or f.altsep and f.altsep in suffix:
            raise ValueError("Invalid suffix %r" % (suffix))
        if suffix and not suffix.startswith('.') or suffix == '.':
            raise ValueError("Invalid suffix %r" % (suffix))
        name = self.name
        if not name:
            raise ValueError("%r has an empty name" % (self,))
        old_suffix = self.suffix
        if not old_suffix:
            name = name + suffix
        else:
            name = name[:-len(old_suffix)] + suffix
        return self._from_parsed_parts(self._drv, self._root,
                                       self._parts[:-1] + [name])
560133
def assign_parser(self, name):
        '''
        
        '''
        for n, p in list(self.Parsers.items()):
            if n != name:
                del self.Parsers[n]
        if len(self.Parsers) != 1:
            raise RuntimeError('Parser cannot be assigned!')
819092
protected void generateNumericConstants(IStyleAppendable it) {
		appendComment(it, "numerical constants"); //$NON-NLS-1$
		appendMatch(it, "sarlNumber", "[0-9][0-9]*\\.[0-9]\\+([eE][0-9]\\+)\\?[fFdD]\\?"); //$NON-NLS-1$ //$NON-NLS-2$
		appendMatch(it, "sarlNumber", "0[xX][0-9a-fA-F]\\+"); //$NON-NLS-1$ //$NON-NLS-2$
		appendMatch(it, "sarlNumber", "[0-9]\\+[lL]\\?"); //$NON-NLS-1$ //$NON-NLS-2$
		appendCluster(it, "sarlNumber"); //$NON-NLS-1$
		hilight("sarlNumber", VimSyntaxGroup.CONSTANT); //$NON-NLS-1$
		it.newLine();
	}
1148244
def register(cls, latin_name, synonyms, reference_assemblies):
        
        species = Species(
            latin_name=latin_name,
            synonyms=synonyms,
            reference_assemblies=reference_assemblies)
        cls._latin_names_to_species[species.latin_name] = species
        for synonym in synonyms:
            if synonym in cls._common_names_to_species:
                raise ValueError("Can't use synonym '%s' for both %s and %s" % (
                    synonym,
                    species,
                    cls._common_names_to_species[synonym]))
            cls._common_names_to_species[synonym] = species
        for reference_name in reference_assemblies:
            if reference_name in cls._reference_names_to_species:
                raise ValueError("Can't use reference '%s' for both %s and %s" % (
                    reference_name,
                    species,
                    cls._reference_names_to_species[reference_name]))
            cls._reference_names_to_species[reference_name] = species
        return species
377226
def add_prefix_and_suffix(specified_name, type, property_set):
    """"""

    property_set = b2.util.jam_to_value_maybe(property_set)

    suffix = ""
    if type:
        suffix = b2.build.type.generated_target_suffix(type, property_set)

    # Handle suffixes for which no leading dot is desired.  Those are
    # specified by enclosing them in <...>.  Needed by python so it
    # can create "_d.so" extensions, for example.
    if get_grist(suffix):
        suffix = ungrist(suffix)
    elif suffix:
        suffix = "." + suffix

    prefix = ""
    if type:
        prefix = b2.build.type.generated_target_prefix(type, property_set)

    if specified_name.startswith(prefix):
        prefix = ""

    if not prefix:
        prefix = ""
    if not suffix:
        suffix = ""
    return prefix + specified_name + suffix
1117297
def _add_namespaces(self):
        
        self.doc.add_namespace(NIDM)
        self.doc.add_namespace(NIIRI)
        self.doc.add_namespace(CRYPTO)
        self.doc.add_namespace(DCT)
        self.doc.add_namespace(DC)
        self.doc.add_namespace(NFO)
        self.doc.add_namespace(OBO)
        self.doc.add_namespace(SCR)
        self.doc.add_namespace(NIF)
183477
def namespaces ns = "root", cn = "__Namespace"
    result = []
    each_instance( ns, cn ) do |inst|
      name = "#{ns}/#{inst.Name}"
      result << name
      result.concat namespaces name, cn
    end
    result.uniq
  end
537977
def fill_constants_types(module_name, elements):
    
    for elem, intrinsic in elements.items():
        if isinstance(intrinsic, dict):  # Submodule case
            fill_constants_types(module_name + (elem,), intrinsic)
        elif isinstance(intrinsic, ConstantIntr):
            # use introspection to get the Python constants types
            cst = getattr(__import__(".".join(module_name)), elem)
            intrinsic.signature = type(cst)
859404
private void initNamespaces(){
		Map<Integer, String> namespaceMap = new HashMap<Integer,String>();
		try{
			int b = read();

			this.keywords.reset();
			StringBuilder buffer = null;

			while (b != -1) {
//				System.out.print((char)b);

				if (buffer != null) {
					buffer.append((char) b);
				}

				if (this.keywords.check((char) b)) {
					switch (this.keywords.getValue()) {

						case KEY_START_NAMESPACES:
							buffer = new StringBuilder(WikipediaXMLKeys.KEY_START_NAMESPACES.getKeyword());
							break;

						case KEY_END_NAMESPACES:
							DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
							factory.setIgnoringElementContentWhitespace(true);
							Document namespaces = factory.newDocumentBuilder().parse(new InputSource(new StringReader(buffer.toString())));


							NodeList nsList = namespaces.getChildNodes().item(0).getChildNodes();

							for (int i = 0; i < nsList.getLength(); i++) {
								Node curNamespace = nsList.item(i);

								//get the prefix for the current namespace
								String prefix = curNamespace.getTextContent().trim();
								if(!prefix.isEmpty()){
									NamedNodeMap nsAttributes = curNamespace.getAttributes();
									String namespace = nsAttributes.getNamedItem("key").getTextContent();
									namespaceMap.put(Integer.parseInt(namespace), prefix);
								}
							}

					    buffer = null;
						articleFilter.initializeNamespaces(namespaceMap);
						return; //init done

					}

					this.keywords.reset();
				}

				b=read();
			}
		}catch(IOException e){
			System.err.println("Error reading namespaces from xml dump.");
		}catch(ParserConfigurationException e){
			System.err.println("Error parsing namespace data.");
		}catch(SAXException e){
			System.err.println("Error parsing namespace data.");
		}
	}
502537
@Override
    protected void configure() {
        bind(new TypeLiteral<String>() {
        }).annotatedWith(Names.named("simulatorContentType")).toInstance("txt");

        bind(new TypeLiteral<String>() {
        }).annotatedWith(Names.named("encoding")).toInstance("Cp278");

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerLength")).toInstance(48);

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerBodyLengthBeginIndex")).toInstance(4);

        bind(new TypeLiteral<Integer>() {
        }).annotatedWith(Names.named("headerBodyLengthEndIndex")).toInstance(8);
    }
171210
public NameAndTypeConstant addNameAndType(String name, String type)
  {
    NameAndTypeConstant entry = getNameAndType(name, type);

    if (entry != null)
      return entry;

    Utf8Constant nameEntry = addUTF8(name);
    Utf8Constant typeEntry = addUTF8(type);

    entry = new NameAndTypeConstant(this, _entries.size(),
                                    nameEntry.getIndex(),
                                    typeEntry.getIndex());

    addConstant(entry);

    return entry;
  }
1368496
public ConstantNameAndTypeInfo addConstantNameAndType(String name,
                                                          Descriptor type) {
        return (ConstantNameAndTypeInfo)addConstant(new ConstantNameAndTypeInfo(this, name, type));
    }
1099593
def to_constant_name(desc) #:nodoc:
      name = case desc
        when String then desc.starts_with?('::') ? desc[2..-1] : desc
        when Symbol then desc.to_s
        when Module
          raise ArgumentError, "Anonymous modules have no name to be referenced by" if desc.name.blank?
          desc.name
        else raise TypeError, "Not a valid constant descriptor: #{desc.inspect}"
      end
    end
127526
public void convertAllPrefixesToDomains() {
        SurtPrefixSet iterCopy = (SurtPrefixSet) this.clone();
        Iterator<String> iter = iterCopy.iterator();
        while (iter.hasNext()) {
            String prefix = (String) iter.next();
            String convPrefix = convertPrefixToDomain(prefix);
            if(prefix!=convPrefix) {
            	// if returned value not unchanged, update set
            	this.remove(prefix);
            	this.add(convPrefix);
            }
        } 
    }
644715
private void applyParser()
	{
		this.snapshot.clear();
		Map<String, String> originals = new HashMap<String, String>(this.resolvers.size());
		for ( Entry<String, VariableValue> resolver : this.resolvers.entrySet() )
		{
			originals.put(resolver.getKey(), resolver.getValue().getOriginal());
		}
		putAll(originals);
	}
410572
def build_prefixes(namespaces=None):
    
    if namespaces is None:
        namespaces = [
            ('bf', str(BIBFRAME)),
            ('schema', str(SCHEMA_ORG))
        ]
    output = "PREFIX {}: <{}>\n".format(
        namespaces[0][0],
        namespaces[0][1])
    if len(namespaces) == 1:
        return output
    else:
        for namespace in namespaces[1:]:
            output += "PREFIX  {}: <{}>\n".format(namespace[0], namespace[1])
    return output