Class BabelAudio


  • public class BabelAudio
    extends Object
    Au audio item in BabelNet.
    Author:
    navigli, vannella
    • Constructor Detail

      • BabelAudio

        public BabelAudio​(String lemma,
                          it.uniroma1.lcl.jlt.util.Language language,
                          String filename)
        Constructor
        Parameters:
        lemma - lemma pronounced
        language - lemma language
        filename - audio filename associated
    • Method Detail

      • getLanguage

        public it.uniroma1.lcl.jlt.util.Language getLanguage()
        Gets the Language of this BabelAudio
        Returns:
        the Language of this BabelAudio.
      • getFileName

        public String getFileName()
        Gets the filename (name.ogg) of this BabelAudio.
        Returns:
        the filename (name.ogg) of this BabelAudio.
      • getUrl

        public String getUrl()
        Gets the full URL this BabelAudio.
        Returns:
        the URL from which this BabelAudio can be retrieved.
      • getValidatedUrl

        @Deprecated
        public String getValidatedUrl()
        Deprecated.
        Returns a valid URL for the audio file
        Returns:
        valid URL
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getResponseCode

        public static int getResponseCode​(String urlString)
                                   throws MalformedURLException,
                                          IOException
        Gets the response code for an input URL string
        Parameters:
        urlString - the URL string
        Returns:
        the response code for an input URL
        Throws:
        MalformedURLException - thrown if the URL is malformed
        IOException - thrown if the URL cannot be opened
      • main

        public static void main​(String[] args)