Ejemplo n.º 1
0
        /// <summary>
        /// Initializes static members of the SharpNL library.
        /// </summary>
        static Library()
        {
            Version = typeof(Library).Assembly.GetName().Version;


            MinOpenNLPVersion = new Ver(1, 5, 0, false);
            MaxOpenNLPVersion = new Ver(1, 6, 0, false);

            LoadKnownTypes();

            TypeResolver = new TypeResolver();

            foreach (var type in knownTypes)
            {
                var attr = type.GetCustomAttribute <TypeClassAttribute>(false);
                if (attr != null)
                {
                    TypeResolver.Register(attr.Name, type);
                }
            }

            langCache = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)
            {
                // preloaded languages in the cache
                { "en", "en" },
                { "pt-PT", "pt" },
                { "pt-BR", "pt" }
            };
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes static members of the SharpNL library.
        /// </summary>
        static Library()
        {
            Version = typeof(Library).Assembly.GetName().Version;

            OpenNLPVersion = new Ver(1, 5, 3, false);

            LoadKnownTypes();

            TypeResolver = new TypeResolver();

            foreach (var type in knownTypes)
            {
                var attr = type.GetCustomAttribute <TypeClassAttribute>(false);
                if (attr != null)
                {
                    TypeResolver.Register(attr.Name, type);
                }
            }
        }