vn
Class Cyc

java.lang.Object
  extended by vn.Cyc

public class Cyc
extends Object

This class implements the mapping of VerbNet verb-frame pairs to Cyc verbSemTrans rules. This is the bulk of the VxC application. A better name for this class might have been Mapper or CycMapper since this class is not merely the embodiment of the Cyc data, but Cyc was chosen for simplicity. VxC uses the Inspector extension method of writing as little code as possible in the EventManager class so that this class, along with Matcher and PrepositionManager, are the embodiment of the extension.

The VxC application accepts 5 additional command-line options (view usage note for more information):

The -C, -M, and -F operators are required. If the -A operator is omitted, -An is assumed.

The Cyc input file is a text file enumerating the Cyc verbSemTrans rules. A Cyc input file supplemental/cyc-rules.txt is provided in the vxc.tar.gz download file. More information on this file can be found here: cycFile.

The manual mapping file contains the hand-made matches between all verb-frame pairs in a handful of VerbNet classes and the Cyc rules. These are assumed to be "correct" matches against which the automatic matching algorithm can be measured. A manual mapping file supplemental/manual-mapping.xml is provided in the vxc.tar.gz download file.

The vxc.tar.gz download file can be found here.

The Cyc class works by receiving requests to look for Cyc matches from the EventManager class. The Inspector system (running in verb-frame pair mode) scans the VerbNet XML files and fire events when it encounters various elements. When it encounters a verb-frame pair it calls findCycMatches(String, String, String, int, String) to search for matches with the Cyc rules. A match is determined by applying all the constraints supplied (via the -A operator) and if the possible match has not been discarded, it is assumed to be a good match. At the end of the program all the results of the automatic matching are printed to stdout.

Here are all of the constraints implemented by the VxC system:

SymbolName Description
0null match excludes all possible matches
  Matcher.nullMatch()
nnaive match excludes only those possible matches whose lemmas are not equal
  Matcher.naive(String, String)
ppreposition excludes those possible matches where VerbNet does not have required Cyc preposition
  Matcher.cycPreposition(String, String)
ttransitivity excludes those possible matches where VerbNet's and Cyc's transitivity do not correspond
  Matcher.transitivity(String, String)
iinfinitive/gerund excludes those possible matches where VerbNet's and Cyc's infinitives or gerunds do not correspond
  Matcher.infinitiveGerund(String, String)
jadjective excludes those possible matches where VerbNet's and Cyc's adjectives do not correspond
  Matcher.adjective(String, String)
ffromLocation implies Source excludes those possible matches where Cyc uses fromLocation and VerbNet does not use Source
  Matcher.fromLocationImpliesSource(String, String)
ddbpb implies Agent excludes those possible matches where Cyc uses doneBy or performedBy and VerbNet does not use Agent
  Matcher.DBPBimpliesAgent(String, String)
mmiddle voice implies no Agent excludes those possible matches where the Cyc rule is a MiddleVoiceFrame but VerbNet uses Agent
  Matcher.middleVoiceNoAgent(String, String)
aall applies all above constraints except 0, in the above order

If -A0 is supplied, no other constraints may be used with it. Constraints will be applied to each possible match in the order that they are supplied in the -A operator's argument. So, -Apt and -Atp will produce the same match output file but if the -Sd flag is provided the it's possible that the reason a possible match was discarded will be different. Using the -Sd flag, the output sent to stderr for -Aabcde and -Aecabd will be the exact same (same reason for discards) if and only if the constraints a, b, c, d, and e discard mutually exclusive sets of possible matches. The final results will not change though, regardless of the order.

The additional flags that apply to the VxC system are supplied by the -S operator. Multiple flags can be specified by this operator. Here are all the VxC system flags and the corresponding variables that represent them:

FlagName Variable
cshow class match counts flShowClassMatchCounts
dshow discards flShowDiscards
mmanual mapping classes only flManualClassesOnly

Finally, to give you an idea of the maginitude of the data (numbers as of VxC v1.0):
   29,245 verb-frame pairs x 3,256 Cyc rules = 95,221,720 possible matches
   26,128 naive matches

Version:
1.0, 2006.10.25
Author:
Derek Trumbo
See Also:
Inspector, EventManager

Nested Class Summary
private static class Cyc.InvalidCycInputFileException
          Exception class for identifying if the Cyc input file is invalid.
private static class Cyc.Match
          This class represents a match between a VerbNet verb-frame pair and a Cyc rule.
 
Field Summary
(package private) static String ALL_MATCH_CONSTRS
          All constraint symbols used with the -A operator.
private static ArrayList AM
          All matches found by the automatic matching algorithm.
private static int classMatchCount
          The number of possible matches that the automatic matching algorithm has marked as 'good' in the current class or subclass.
private static String curClass
          The current class or subclass that the Inspector is scanning.
(package private) static File cycFile
          The file containing all the verbSemTrans rules from Cyc.
(package private) static File cycFileCmp
          The compressed version of the Cyc input file (cycFile).
private static ArrayList[] cycRules
          All Cyc rules.
(package private) static String flags
          A string representation of all of the flags supplied on the command line.
(package private) static boolean flManualClassesOnly
          A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system that classes not covered by the manual mapping should be ignored (this will save you time) Most of the final results are based off of the manual mapping.
(package private) static boolean flShowClassMatchCounts
          A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system that the number of good matches found in each class and each subclass should be printed.
(package private) static boolean flShowDiscards
          A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system to print a line of text to stderr for each possible match that was discarded.
private static boolean isManualClass
          Whether or not the current class is covered by the manual mapping file.
private static ArrayList manClasses
          The list of classes and subclasses covered by the manual mapping.
(package private) static File manFile
          The manual mapping file.
private static String manualVersion
          The VerbNet and Cyc versions to which the manual mapping file corresponds.
(package private) static String matchConstraints
          A string representation of all of the constraints supplied on the command line.
(package private) static File matchFile
          The file to which matches found by the automatic matching algorithm should be written.
private static PrintWriter matchpw
          The PrintWriter object tied to the match output file.
private static ArrayList MM
          All matches specified in the manual mapping file.
private static int numAMDiscardsInManClasses
          The number of rules discarded by the automatic matching algorithm from classes covered by the manual mapping file.
 
Constructor Summary
private Cyc()
          This constructor is private because the class is not intended to ever be instantiated.
 
Method Summary
private static void addRuleNumbersAndCompress()
          Compresses the original Cyc input file into another file which has one line per verbSemTrans rule.
(package private) static void closeExternalData()
          Writes the end tag of the document element to the match output file and closes the stream.
(package private) static void compareMatches()
          Calculates all statistics and displays the final results section.
(package private) static String cycExtractParticle(String rule)
          Returns the particle in a particle construction (i.e. "off" in "shear off").
(package private) static String cycExtractPreposition(String rule)
          Returns the preposition specified by a Cyc rule.
(package private) static String cycExtractRuleNum(String rule)
          Returns the rule number applied to this Cyc rule in addRuleNumbersAndCompress().
(package private) static String cycExtractTrans(String rule)
          Returns the transitivity of this Cyc rule represented by a small handful of characters.
private static String cycExtractVerb(String rule)
          Returns the verb of a Cyc rule.
(package private) static boolean cycHasParticle(String rule)
          Returns whether or not a Cyc rule deals with a particle construction (i.e. "shear off").
(package private) static boolean cycHasPreposition(String rule)
          Returns whether or not a Cyc rule specifies a preposition (i.e. "bicker with").
private static void eprint(String s)
          Used as shorthand for System.err.print.
private static void eprintln(String s)
          Used as shorthand for System.err.println.
(package private) static void findCycMatches(String verb, String vnSyntax, String vnSem, int vnFrameID, String vnFrameDesc)
          Searches the Cyc rules for a match to the verb-frame pair currently being scanned by the Inspector.
(package private) static void initialize()
          Initializes some class variables and prints the header.
private static void loadCycRules()
          Loads the Cyc rules stored in the compressed file into class-level data structures.
(package private) static void loadExternalData()
          Loads all the Cyc rules from the Cyc input file and the manual matches from the manual mapping file.
private static void loadManualFile()
          Loads the manual matches stored in the manual mapping file into the list of manual matches MM.
private static void print(String s)
          Used as shorthand for System.out.print.
(package private) static void printClassMatchCount(int level)
          Prints the number of matches found by the automatic matching algorithm for this class or subclass.
private static void printHeader()
          Prints the header for this execution of the VxC mapper.
private static void println(String s)
          Used as shorthand for System.out.println.
private static int roundPct(double d)
          Returns as an integer the first two significant figures of a floating point number between 0 and 1, inclusive.
(package private) static void setClass(String newClassName)
          Sets the current class or subclass that the Inspector is scanning.
private static void setUpMatchFile()
          Prepares the match output file to be written to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

static String flags
A string representation of all of the flags supplied on the command line. All flags can be separate from one another or combined into a single command line token. This string accumulates all the flags supplied on the command line so they can all be printed out nicely in the VxC header.

See Also:
Inspector.analyzeArguments(String[]), printHeader()

flShowDiscards

static boolean flShowDiscards
A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system to print a line of text to stderr for each possible match that was discarded. This line of text includes the reason for discarding. This is shown by displaying the constraint symbol corresponding to the constraint method which signalled to discard the possible match. Remember that constraints are applied in the order they appear in the -A operator's argument. Therefore, the reason for discard could be different based on different arrangements of this arugment (i.e. pti vs. itp).

See Also:
Inspector.analyzeArguments(String[]), findCycMatches(String, String, String, int, String)

flManualClassesOnly

static boolean flManualClassesOnly
A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system that classes not covered by the manual mapping should be ignored (this will save you time) Most of the final results are based off of the manual mapping. Sometimes it makes sense to ignore all other classes, if you're just looking to gauge performance of the matching algorithm.

See Also:
Inspector.analyzeArguments(String[]), setClass(String), findCycMatches(String, String, String, int, String)

flShowClassMatchCounts

static boolean flShowClassMatchCounts
A flag set in Inspector.analyzeArguments(String[]) and used to indicate that the user would like the VxC system that the number of good matches found in each class and each subclass should be printed. This printing of a class's or subclass's match count takes place right before a new class begins (or when the </FRAMES> tag is reached). The sum of all these counts will be equal to [Correct Matches] + [Incorrect Matches] in the final results section.

See Also:
Inspector.analyzeArguments(String[]), printClassMatchCount(int)

cycFile

static File cycFile
The file containing all the verbSemTrans rules from Cyc. One is provided in the vxc.tar.gz download file for VxC. This file was obtained by performing these steps:
See Also:
Inspector.analyzeArguments(String[]), printHeader(), addRuleNumbersAndCompress()

cycFileCmp

static File cycFileCmp
The compressed version of the Cyc input file (cycFile). When the data is extracted from Cyc, each rule spans multiple lines. The method addRuleNumbersAndCompress() removes newline characters in order to create a Cyc rule file with one rule per line. This file is always named FILE.vxc.compressed where FILE is the name of the Cyc input file provided on the command line (-C operator). The compressed file is placed into the directory where the java vn.Inspector command was executed.

See Also:
Inspector.analyzeArguments(String[]), printHeader(), addRuleNumbersAndCompress(), loadCycRules()

cycRules

private static ArrayList[] cycRules
All Cyc rules. This is an array of arrays. This array contains one element for each letter of the alphabet. Each element is itself an ArrayList object. Each rule is added to the array that corresponds to the rule's verb. This is done to decrease access time when checking to see if a VerbNet syntax matches any Cyc rules. Each of the 26 arrays are held in unsorted order. There exist many other ways to store these rules so as to achieve even faster access times.

See Also:
loadCycRules(), findCycMatches(String, String, String, int, String)

manFile

static File manFile
The manual mapping file. This contains all the manual mappings performed by the author of this software upon the original creation of VxC. This should be a file in XML format with an inline DTD. One is provided in the vxc.tar.gz download file for VxC.

See Also:
Inspector.analyzeArguments(String[]), printHeader(), loadManualFile()

AM

private static ArrayList AM
All matches found by the automatic matching algorithm. A Cyc.Match object is added to this array every time the automatic matching algorithm has no reason, based on the desired constraints, to discard the match.

See Also:
initialize(), findCycMatches(String, String, String, int, String), compareMatches()

MM

private static ArrayList MM
All matches specified in the manual mapping file. There is one Cyc.Match object added to this array for each or element in the file.

See Also:
initialize(), loadManualFile(), compareMatches()

manClasses

private static ArrayList manClasses
The list of classes and subclasses covered by the manual mapping. One string is added to this array for each element in the file. This is used to determine if the current class or subclass being scanned by the Inspector was covered by the manual mapping file.

See Also:
setClass(String), initialize(), loadManualFile(), compareMatches()

numAMDiscardsInManClasses

private static int numAMDiscardsInManClasses
The number of rules discarded by the automatic matching algorithm from classes covered by the manual mapping file. This statistic is required in the final results section to produce the correct numbers.

See Also:
findCycMatches(String, String, String, int, String), compareMatches()

manualVersion

private static String manualVersion
The VerbNet and Cyc versions to which the manual mapping file corresponds. The manual mapping file is created with respect to a given VerbNet version and that version is stored in an attribute of the document root element of the file. This value will be replicated to the match output file to give that file some version context. It should be noted that VxC should never be run with a VerbNet version different than that listed in the manual mapping file that you are using - this can cause inaccurate matches and discards. The same can be said for Cyc. The verbSemTrans rules contained inside the download were extracted from the version of ResearchCyc listed in the manual mapping file. This version number is more for informational purposes, rather than for compatibility purposes, since the only real important warning concerning the Cyc rules and the manual mapping file is that the Cyc rule numbers shown in the manual mapping file must correspond to the order in which they appear in the included Cyc rule file. So the manual mapping file will be invalid if paired with a different verbSemTrans file that is ordered differently.

See Also:
loadManualFile(), setUpMatchFile()

matchFile

static File matchFile
The file to which matches found by the automatic matching algorithm should be written. The output format will be in XML and should be very similar to the manual mapping file

See Also:
Inspector.analyzeArguments(String[]), printHeader(), setUpMatchFile()

matchpw

private static PrintWriter matchpw
The PrintWriter object tied to the match output file.

See Also:
setUpMatchFile(), closeExternalData(), findCycMatches(String, String, String, int, String)

ALL_MATCH_CONSTRS

static final String ALL_MATCH_CONSTRS
All constraint symbols used with the -A operator. These are all available constraints that the user can specify. See the Cyc class's description for an explanation of each constraint.

See Also:
Inspector.analyzeArguments(String[]), Constant Field Values

matchConstraints

static String matchConstraints
A string representation of all of the constraints supplied on the command line. All constraints can be separate from one another on the command line (i.e. you can specify multiple -A operators). This string represents all -A operator arguments as one.

See Also:
Inspector.analyzeArguments(String[]), printHeader(), findCycMatches(String, String, String, int, String)

curClass

private static String curClass
The current class or subclass that the Inspector is scanning. This is important for determining whether the current class is covered by the manual mapping file and for writing to the match output file, etc.

See Also:
setClass(String), printClassMatchCount(int), findCycMatches(String, String, String, int, String)

isManualClass

private static boolean isManualClass
Whether or not the current class is covered by the manual mapping file. If the -Sm flag is supplied then the no possible matches will be examined in classes that are not covered in the manual mapping file.

See Also:
setClass(String), findCycMatches(String, String, String, int, String), findCycMatches(String, String, String, int, String)

classMatchCount

private static int classMatchCount
The number of possible matches that the automatic matching algorithm has marked as 'good' in the current class or subclass. This is reset at the beginning of each class or subclass and is incremented each time a match is added to AM. This is used only to implement the -Sc flag (flShowClassMatchCounts).

See Also:
setClass(String), printClassMatchCount(int), findCycMatches(String, String, String, int, String)
Constructor Detail

Cyc

private Cyc()
This constructor is private because the class is not intended to ever be instantiated. The VxC application is a very procedural process and thus all the members are static.

Method Detail

println

private static void println(String s)
Used as shorthand for System.out.println.

Parameters:
s - the string to print to stdout, followed by a carriage return
See Also:
PrintStream.println(String)

print

private static void print(String s)
Used as shorthand for System.out.print.

Parameters:
s - the string to print to stdout
See Also:
PrintStream.print(String)

eprintln

private static void eprintln(String s)
Used as shorthand for System.err.println.

Parameters:
s - the string to print
See Also:
PrintStream.println(String)

eprint

private static void eprint(String s)
Used as shorthand for System.err.print.

Parameters:
s - the string to print
See Also:
PrintStream.print(String)

setClass

static void setClass(String newClassName)
Sets the current class or subclass that the Inspector is scanning. Sets whether or not this class or subclass was covered in the manual mapping file. Resets the class match counter.

Parameters:
newClassName - the new class name ('ID' attribute from VerbNet XML files)
See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element), isManualClass, manClasses

printClassMatchCount

static void printClassMatchCount(int level)
Prints the number of matches found by the automatic matching algorithm for this class or subclass. This method does nothing if flShowClassMatchCounts is false.

See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element)

initialize

static void initialize()
Initializes some class variables and prints the header.

See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element), printHeader()

printHeader

private static void printHeader()
Prints the header for this execution of the VxC mapper. All command line arguments are regurgitated and the date and time of this execution is shown.

See Also:
Inspector.filePath(File), initialize()

loadExternalData

static void loadExternalData()
Loads all the Cyc rules from the Cyc input file and the manual matches from the manual mapping file. Also prepares the match output file to be written to.

See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element)

closeExternalData

static void closeExternalData()
Writes the end tag of the document element to the match output file and closes the stream.

See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element)

addRuleNumbersAndCompress

private static void addRuleNumbersAndCompress()
                                       throws Cyc.InvalidCycInputFileException,
                                              IOException
Compresses the original Cyc input file into another file which has one line per verbSemTrans rule. The automatic matching algorithm gains nothing by having the Cyc rules spread across multiple files so it converts the Cyc input file into a condensed format for efficiency. The output file name is the input file name with the characters ".vxc.compressed" appended to it and is located the directory where java vn.Inspector was invoked.

This method also adds rule numbers for convenient identification of Cyc rules. They are assigned in the order that the rules are are encountered in the file. The Cyc rule numbering applied in this method corresponds to those used in the manual mapping file.

Throws:
Cyc.InvalidCycInputFileException
IOException
See Also:
loadExternalData()

loadCycRules

private static void loadCycRules()
                          throws IOException
Loads the Cyc rules stored in the compressed file into class-level data structures. Each line of the file represents a different rule and will be placed into a list containing rules whose verb starts with the same letter.

Throws:
IOException
See Also:
loadExternalData(), cycRules

setUpMatchFile

private static void setUpMatchFile()
                            throws IOException
Prepares the match output file to be written to. This opens and initializes the stream that will be written to each time a match is found.

Throws:
IOException
See Also:
loadExternalData(), findCycMatches(String, String, String, int, String)

loadManualFile

private static void loadManualFile()
                            throws Exception
Loads the manual matches stored in the manual mapping file into the list of manual matches MM. Loads the names of all the classes covered by the manual mapping file into the list of manual mapping classes manClasses. This method assumes there are both <tuple> and <tuple-m> (maybe tuples) elements in the manual mapping file. This method considers both of them to be good matches. Only the final results section makes a distinction when printing out those matches which the automatic matching algorithm failed to match by printing the word 'maybe' next to a match if it was so identified in the manual mapping file.

Throws:
Exception
See Also:
loadExternalData(), MM, manClasses

cycExtractVerb

private static String cycExtractVerb(String rule)
Returns the verb of a Cyc rule. This is the contained in the first argument after the verbSemTrans predicate. For example, the following rule contains the verb "jump":
  RULE #2244 [Def](verbSemTrans Jump-TheWord 0 IntransitiveVerbFrame ...

Parameters:
rule - the Cyc rule to examine
Returns:
the verb of the Cyc rule
See Also:
loadCycRules(), findCycMatches(String, String, String, int, String)

cycHasParticle

static boolean cycHasParticle(String rule)
Returns whether or not a Cyc rule deals with a particle construction (i.e. "shear off"). A Cyc rule deals with a particle construction if it contains the token ParticleCompFrameFn.

Parameters:
rule - the Cyc rule to examine
Returns:
whether or not the Cyc rule deals with a particle construction

cycExtractParticle

static String cycExtractParticle(String rule)
Returns the particle in a particle construction (i.e. "off" in "shear off").

Parameters:
rule - the Cyc rule to examine
Returns:
the particle associated with this rule or a zero-length string if the Cyc rule does not contain a particle.

cycHasPreposition

static boolean cycHasPreposition(String rule)
Returns whether or not a Cyc rule specifies a preposition (i.e. "bicker with"). A Cyc rule specifies a preposition if it contains the token PPCompFrameFn. The Cyc rule that specifies a preposition in this matter is saying that the Cyc rule is only valid when the verb is used with the given preposition.

Parameters:
rule - the Cyc rule to examine
Returns:
whether or not the Cyc rule specifies a preposition using which the predicate rule is valid
See Also:
Matcher.cycPreposition(String, String)

cycExtractPreposition

static String cycExtractPreposition(String rule)
Returns the preposition specified by a Cyc rule. For example, the following rule (uncompressed) contains the verb and preposition "bicker with":
[Def](verbSemTrans Bicker-TheWord 0
    (PPCompFrameFn TransitivePPFrameType With-TheWord)
    ...

Parameters:
rule - the Cyc rule to examine
Returns:
the preposition specified by the Cyc rule or a zero-length string if the Cyc rule does not specify a preposition.
See Also:
Matcher.cycPreposition(String, String)

cycExtractRuleNum

static String cycExtractRuleNum(String rule)
Returns the rule number applied to this Cyc rule in addRuleNumbersAndCompress().

Parameters:
rule - the Cyc rule to examine
Returns:
the rule number of this Cyc rule
See Also:
addRuleNumbersAndCompress(), findCycMatches(String, String, String, int, String)

cycExtractTrans

static String cycExtractTrans(String rule)
Returns the transitivity of this Cyc rule represented by a small handful of characters. The different abbreviations and the tokens involved in the Cyc rules that correspond to them are:

Parameters:
rule - the Cyc rule to examine
Returns:
a string representing the transitivity of the Cyc rule
See Also:
Matcher.transitivity(String, String)

findCycMatches

static void findCycMatches(String verb,
                           String vnSyntax,
                           String vnSem,
                           int vnFrameID,
                           String vnFrameDesc)
Searches the Cyc rules for a match to the verb-frame pair currently being scanned by the Inspector. The required verb-frame pair information (verb, frame, syntax, semantics) is given to this method by the EventManager class. Not all of the Cyc rules are searched. In order to increase the speed of this method, the Cyc rules are broken apart into separate lists based on the first letter of their verb. When this method is invoked, it only scans the list corresponding to the first letter of the VerbNet verb in question (there are even more efficient ways of implementing this).

For each Cyc rule visited, the constraints given in the -A operator are applied in an attempt to discard the [verb-frame, Cyc rule] match. If none of the constraints can discard the possible match, then it is considered a good match and added to AM.

This method writes a line to the match output file for every good match and if the proper flag is supplied, it writes a line of text to stderr for every possible match discarded within a manual mapping class.

Parameters:
verb - the verb from the VerbNet verb-frame pair
vnSyntax - the syntax from the VerbNet verb-frame pair
vnSem - the semantics from the VerbNet verb-frame pair. This is a conglomeration of all the semantic predicates in one string.
vnFrameID - the frame number from the VerbNet verb-frame pair
vnFrameDesc - the primary and secondary frame descriptions from the VerbNet verb-frame pair
See Also:
cycRules, findCycMatches(String, String, String, int, String), EventManager.fireEvent(int, int, String, String, String, Element, Element), Matcher

compareMatches

static void compareMatches()
Calculates all statistics and displays the final results section. All results are calculated using only the information in AM, MM, and numAMDiscardsInManClasses. Final results are displayed to stdout and consist of three parts:

See Also:
EventManager.fireEvent(int, int, String, String, String, Element, Element)

roundPct

private static int roundPct(double d)
Returns as an integer the first two significant figures of a floating point number between 0 and 1, inclusive. For example, 0.37945261 is converted to 38. This is done so that the returned value represents a percent value.

Parameters:
d - the floating point value to round and convert to a percentage
Returns:
an integer value representing the rounded value of the input value times 100.
See Also:
compareMatches()