GithubHelp home page GithubHelp logo

gmantele / ucidy Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 0.0 2.68 MB

Lightweight Java library to validate UCDs (Unified Content Descriptors).

License: GNU Lesser General Public License v3.0

Java 100.00%
ivoa java ucd validation

ucidy's People

Contributors

gmantele avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ucidy's Issues

Text resource file locations

When packaging ucidy with other libraries, it's a bit untidy to have the resource text files ucd1p-words.txt, ucd1p-deprecated.txt at the top level of the namespace. Any chance of moving them to ari/ucidy/?

Categorising UCD status

@gmantele, I'm trying to write a function that reports a single category for a presented UCD. My current attempt looks like this:

        UCD pucd = UCDParser.parseUCD( ucd );
        if ( ! pucd.isAllValid() ) {
            return "BAD_SYNTAX";
        }
        else if ( ! pucd.isAllRecognised() ) {
            return "UNKNOWN_ATOM";
        }
        else if ( ! pucd.isFullyValid() ) {
            return "BAD_SEQUENCE";
        }
        else if ( ! pucd.isAllRecommended() ) {
            return "DEPRECATED";
        }
        else {
            return "OK";
        }

However, it's not doing what I want. In particular it never seems to report DEPRECATED, because deprecated words are flagged as not recognised as well as not recommended, which is not what I expected from the UCDWord javadocs:

jshell> UCDParser.parseUCD("time.expo").isAllRecognised();
$27 ==> false

jshell> UCDParser.parseUCD("time.expo").getErrors().next();
$28 ==> "1 DEPRECATED UCD word: \"time.expo (-> time.duration;obs.exposure)\"!"

Can you advise? Thanks.

UCD list version reporting

Feature request: it would be nice if UCDParser instances could report what version of the UCDList standard (i.e. what word lists) they implement, e.g. if UCDParser.defaultParser.getVersion() could return "EN-UCD1+-1.4" or "EN-UCD1+-1.4 with Erratum 1" or similar. Obviously that information would have to be supplied at UCDParser construction time.

non-public UCDParser.defaultParser

@gmantele, is there a good reason that the UCDParser.defaultParser instance is declared with scope protected? It makes it complicated to work with custom UCDParser instances, e.g. to get a copy of the default word list (though not impossible, you can get access to the member by subclassing UCDParser). If there's not a good reason, could it be promoted to public?

stderr output

For library (as opposed to standalone) use, it's a bit annoying to have output printed direct to stderr. In the current v1.2-beta, when the class UCDParser class is first loaded, the following text is written to stderr:

[l.212] ERROR: Skipped deprecated UCD declaration! Cause: The UCD word "meta.ref.ivorn" can not be declared as deprecated! It is already listed among the recognised UCD words.

I understand the standards issue that this is referring to, and I guess it will go away when v1.2 is finalised, but if the situation is likely to persist a nicer alternative would be to have such output e.g. sent through the java.util.logging system so it can be controlled by client applications. I can prepare a PR to do this if you like.

Classpath "."

The manifest of the released jar file is built according to this section of the build.xml file:

     <manifest>
       <attribute name="Main-Class" value="${main.runnable.class}"/>
       <attribute name="Class-Path" value="."/>
     </manifest>

I don't know why the "." class-path entry is added here. It could present some kind of minor security issue, but the real reason I mention it is because it messes up part of my build system. I can certainly work round it if required, but if there's no good reason for its presence, could it be removed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.