Primer Encuentro

This commit is contained in:
2023-06-20 21:31:55 -04:00
parent 2dbcf0f875
commit 1621e8fb6c
82 changed files with 18016 additions and 0 deletions

View File

@ -0,0 +1,78 @@
.I 1
.W
the crystalline lens in vertebrates, including humans.
.I 2
.W
the relationship of blood and cerebrospinal fluid oxygen concentrations
or partial pressures. a method of interest is polarography.
.I 3
.W
electron microscopy of lung or bronchi.
.I 4
.W
tissue culture of lung or bronchial neoplasms.
.I 5
.W
the crossing of fatty acids through the placental barrier. normal
fatty acid levels in placenta and fetus.
.I 6
.W
ventricular septal defect occurring in association with aortic
regurgitation.
.I 7
.W
radioisotopes in heart scanning. mainly used in diagnosis of
pericardial effusions. also used to study tumors, heart enlargement,
aneurysms and pericardial thickening. technetium, rihsa, radioactive
hippurate, cholegraffin are used.
.I 8
.W
the effects of drugs on the bone marrow of man and animals,
specifically the effect of pesticides. also, the significance
of bone marrow changes.
.I 9
.W
the use of induced hypothermia in heart surgery, neurosurgery, head
injuries and infectious diseases.
.I 10
.W
neoplasm immunology.
.I 11
.W
blood or urinary steroids in human breast or prostatic neoplasms.
.I 12
.W
effect of azathioprine on systemic lupus erythematosus, particularly
in regard to renal lesions.
.I 13
.W
bacillus subtilis phages and genetics, with particular reference
to transduction.
.I 14
.W
renal amyloidosis as a complication of tuberculosis and the effects
of steroids on this condition. only the terms kidney diseases and
nephrotic syndrome were selected by the requester. prednisone and
prednisolone are the only steroids of interest.
.I 15
.W
homonymous hemianopsia in visual aphasia, particularly
measurement and assessment. gerstmann's syndrome and agnosia are also
of interest.
.I 16
.W
separation anxiety in infancy (i.e. up to two years of age) and in
preschool children, particularly separation of a child from its mother.
.I 17
.W
nickel in nutrition: requirements for methods for analysis; relation
with enzyme systems; toxicity of, in humans and laboratory animals;
deficiency signs and symptoms; level in various foodstuffs; level in
blood and tissues.
.I 18
.W
the toxicity of organic selenium compounds.
.I 19
.W
excretion of phosphate or pyrophosphate in the urine or the effect of
parathyroid hormone on kidney.

View File

@ -0,0 +1,361 @@
1 13 0 0.000000
1 14 0 0.000000
1 15 0 0.000000
1 72 0 0.000000
1 79 0 0.000000
1 138 0 0.000000
1 142 0 0.000000
1 164 0 0.000000
1 165 0 0.000000
1 166 0 0.000000
1 167 0 0.000000
1 168 0 0.000000
1 169 0 0.000000
1 170 0 0.000000
1 171 0 0.000000
1 172 0 0.000000
1 180 0 0.000000
1 181 0 0.000000
1 182 0 0.000000
1 183 0 0.000000
1 184 0 0.000000
1 185 0 0.000000
1 186 0 0.000000
1 211 0 0.000000
1 212 0 0.000000
1 499 0 0.000000
1 500 0 0.000000
1 501 0 0.000000
1 502 0 0.000000
1 503 0 0.000000
1 504 0 0.000000
1 506 0 0.000000
1 507 0 0.000000
1 508 0 0.000000
1 510 0 0.000000
1 511 0 0.000000
1 513 0 0.000000
2 80 0 0.000000
2 90 0 0.000000
2 162 0 0.000000
2 187 0 0.000000
2 236 0 0.000000
2 237 0 0.000000
2 258 0 0.000000
2 289 0 0.000000
2 290 0 0.000000
2 292 0 0.000000
2 293 0 0.000000
2 294 0 0.000000
2 296 0 0.000000
2 300 0 0.000000
2 301 0 0.000000
2 303 0 0.000000
3 59 0 0.000000
3 62 0 0.000000
3 67 0 0.000000
3 69 0 0.000000
3 70 0 0.000000
3 71 0 0.000000
3 73 0 0.000000
3 78 0 0.000000
3 81 0 0.000000
3 160 0 0.000000
3 163 0 0.000000
3 230 0 0.000000
3 231 0 0.000000
3 232 0 0.000000
3 233 0 0.000000
3 234 0 0.000000
3 276 0 0.000000
3 277 0 0.000000
3 279 0 0.000000
3 282 0 0.000000
3 283 0 0.000000
3 287 0 0.000000
4 93 0 0.000000
4 94 0 0.000000
4 96 0 0.000000
4 141 0 0.000000
4 173 0 0.000000
4 174 0 0.000000
4 175 0 0.000000
4 176 0 0.000000
4 177 0 0.000000
4 178 0 0.000000
4 207 0 0.000000
4 208 0 0.000000
4 209 0 0.000000
4 210 0 0.000000
4 259 0 0.000000
4 396 0 0.000000
4 397 0 0.000000
4 399 0 0.000000
4 400 0 0.000000
4 404 0 0.000000
4 405 0 0.000000
4 406 0 0.000000
4 408 0 0.000000
5 1 0 0.000000
5 2 0 0.000000
5 4 0 0.000000
5 5 0 0.000000
5 6 0 0.000000
5 7 0 0.000000
5 8 0 0.000000
5 9 0 0.000000
5 10 0 0.000000
5 11 0 0.000000
5 12 0 0.000000
5 158 0 0.000000
5 159 0 0.000000
5 188 0 0.000000
5 304 0 0.000000
5 305 0 0.000000
5 306 0 0.000000
5 307 0 0.000000
5 325 0 0.000000
5 326 0 0.000000
5 327 0 0.000000
5 329 0 0.000000
5 330 0 0.000000
5 331 0 0.000000
5 332 0 0.000000
5 333 0 0.000000
6 112 0 0.000000
6 115 0 0.000000
6 116 0 0.000000
6 118 0 0.000000
6 122 0 0.000000
6 238 0 0.000000
6 239 0 0.000000
6 242 0 0.000000
6 260 0 0.000000
6 309 0 0.000000
6 320 0 0.000000
6 321 0 0.000000
6 323 0 0.000000
7 92 0 0.000000
7 121 0 0.000000
7 189 0 0.000000
7 247 0 0.000000
7 261 0 0.000000
7 382 0 0.000000
7 385 0 0.000000
7 386 0 0.000000
7 387 0 0.000000
7 388 0 0.000000
7 389 0 0.000000
7 390 0 0.000000
7 391 0 0.000000
7 392 0 0.000000
7 393 0 0.000000
8 52 0 0.000000
8 60 0 0.000000
8 61 0 0.000000
8 123 0 0.000000
8 190 0 0.000000
8 251 0 0.000000
8 262 0 0.000000
8 263 0 0.000000
8 264 0 0.000000
8 265 0 0.000000
8 266 0 0.000000
9 30 0 0.000000
9 31 0 0.000000
9 53 0 0.000000
9 56 0 0.000000
9 57 0 0.000000
9 64 0 0.000000
9 83 0 0.000000
9 84 0 0.000000
9 89 0 0.000000
9 124 0 0.000000
9 125 0 0.000000
9 126 0 0.000000
9 192 0 0.000000
9 252 0 0.000000
9 253 0 0.000000
9 267 0 0.000000
9 268 0 0.000000
9 269 0 0.000000
9 270 0 0.000000
9 271 0 0.000000
9 272 0 0.000000
9 273 0 0.000000
9 409 0 0.000000
9 412 0 0.000000
9 415 0 0.000000
9 420 0 0.000000
9 421 0 0.000000
9 422 0 0.000000
10 54 0 0.000000
10 55 0 0.000000
10 58 0 0.000000
10 152 0 0.000000
10 153 0 0.000000
10 154 0 0.000000
10 155 0 0.000000
10 254 0 0.000000
10 255 0 0.000000
10 256 0 0.000000
10 257 0 0.000000
10 529 0 0.000000
10 531 0 0.000000
10 532 0 0.000000
10 533 0 0.000000
10 534 0 0.000000
10 535 0 0.000000
10 537 0 0.000000
10 538 0 0.000000
10 539 0 0.000000
10 540 0 0.000000
10 541 0 0.000000
10 542 0 0.000000
10 543 0 0.000000
11 32 0 0.000000
11 63 0 0.000000
11 66 0 0.000000
11 148 0 0.000000
11 150 0 0.000000
11 225 0 0.000000
11 226 0 0.000000
11 228 0 0.000000
11 229 0 0.000000
11 440 0 0.000000
11 441 0 0.000000
11 444 0 0.000000
11 445 0 0.000000
11 446 0 0.000000
11 447 0 0.000000
11 448 0 0.000000
11 451 0 0.000000
11 452 0 0.000000
12 16 0 0.000000
12 17 0 0.000000
12 19 0 0.000000
12 20 0 0.000000
12 193 0 0.000000
12 364 0 0.000000
12 365 0 0.000000
12 366 0 0.000000
12 367 0 0.000000
13 21 0 0.000000
13 22 0 0.000000
13 143 0 0.000000
13 144 0 0.000000
13 145 0 0.000000
13 146 0 0.000000
13 194 0 0.000000
13 195 0 0.000000
13 196 0 0.000000
13 197 0 0.000000
13 198 0 0.000000
13 199 0 0.000000
13 470 0 0.000000
13 471 0 0.000000
13 474 0 0.000000
13 475 0 0.000000
13 477 0 0.000000
13 478 0 0.000000
13 479 0 0.000000
13 481 0 0.000000
13 483 0 0.000000
14 23 0 0.000000
14 24 0 0.000000
14 25 0 0.000000
14 26 0 0.000000
14 28 0 0.000000
14 29 0 0.000000
14 454 0 0.000000
14 455 0 0.000000
14 456 0 0.000000
14 457 0 0.000000
14 459 0 0.000000
14 461 0 0.000000
14 463 0 0.000000
14 466 0 0.000000
14 467 0 0.000000
14 468 0 0.000000
15 33 0 0.000000
15 34 0 0.000000
15 101 0 0.000000
15 102 0 0.000000
15 104 0 0.000000
15 105 0 0.000000
15 107 0 0.000000
15 109 0 0.000000
15 110 0 0.000000
15 140 0 0.000000
15 215 0 0.000000
15 216 0 0.000000
15 218 0 0.000000
15 219 0 0.000000
15 220 0 0.000000
15 222 0 0.000000
15 349 0 0.000000
15 350 0 0.000000
15 351 0 0.000000
15 352 0 0.000000
15 353 0 0.000000
15 355 0 0.000000
15 356 0 0.000000
15 357 0 0.000000
15 358 0 0.000000
15 359 0 0.000000
15 361 0 0.000000
15 362 0 0.000000
15 363 0 0.000000
16 35 0 0.000000
16 36 0 0.000000
16 98 0 0.000000
16 99 0 0.000000
16 202 0 0.000000
16 205 0 0.000000
16 484 0 0.000000
16 487 0 0.000000
16 488 0 0.000000
16 490 0 0.000000
16 492 0 0.000000
16 493 0 0.000000
16 495 0 0.000000
17 37 0 0.000000
17 38 0 0.000000
17 39 0 0.000000
17 41 0 0.000000
17 42 0 0.000000
17 127 0 0.000000
17 129 0 0.000000
17 130 0 0.000000
17 131 0 0.000000
17 132 0 0.000000
17 133 0 0.000000
17 334 0 0.000000
17 335 0 0.000000
17 337 0 0.000000
17 338 0 0.000000
17 339 0 0.000000
17 340 0 0.000000
17 341 0 0.000000
17 342 0 0.000000
17 346 0 0.000000
17 348 0 0.000000
18 43 0 0.000000
18 514 0 0.000000
18 515 0 0.000000
18 516 0 0.000000
18 517 0 0.000000
18 518 0 0.000000
18 519 0 0.000000
18 521 0 0.000000
18 522 0 0.000000
18 523 0 0.000000
18 524 0 0.000000
18 525 0 0.000000
18 526 0 0.000000
18 527 0 0.000000
18 528 0 0.000000
19 544 0 0.000000
19 545 0 0.000000
19 549 0 0.000000
19 550 0 0.000000

View File

@ -0,0 +1,571 @@
a
a's
able
about
above
according
accordingly
across
actually
after
afterwards
again
against
ain't
all
allow
allows
almost
alone
along
already
also
although
always
am
among
amongst
an
and
another
any
anybody
anyhow
anyone
anything
anyway
anyways
anywhere
apart
appear
appreciate
appropriate
are
aren't
around
as
aside
ask
asking
associated
at
available
away
awfully
b
be
became
because
become
becomes
becoming
been
before
beforehand
behind
being
believe
below
beside
besides
best
better
between
beyond
both
brief
but
by
c
c'mon
c's
came
can
can't
cannot
cant
cause
causes
certain
certainly
changes
clearly
co
com
come
comes
concerning
consequently
consider
considering
contain
containing
contains
corresponding
could
couldn't
course
currently
d
definitely
described
despite
did
didn't
different
do
does
doesn't
doing
don't
done
down
downwards
during
e
each
edu
eg
eight
either
else
elsewhere
enough
entirely
especially
et
etc
even
ever
every
everybody
everyone
everything
everywhere
ex
exactly
example
except
f
far
few
fifth
first
five
followed
following
follows
for
former
formerly
forth
four
from
further
furthermore
g
get
gets
getting
given
gives
go
goes
going
gone
got
gotten
greetings
h
had
hadn't
happens
hardly
has
hasn't
have
haven't
having
he
he's
hello
help
hence
her
here
here's
hereafter
hereby
herein
hereupon
hers
herself
hi
him
himself
his
hither
hopefully
how
howbeit
however
i
i'd
i'll
i'm
i've
ie
if
ignored
immediate
in
inasmuch
inc
indeed
indicate
indicated
indicates
inner
insofar
instead
into
inward
is
isn't
it
it'd
it'll
it's
its
itself
j
just
k
keep
keeps
kept
know
knows
known
l
last
lately
later
latter
latterly
least
less
lest
let
let's
like
liked
likely
little
look
looking
looks
ltd
m
mainly
many
may
maybe
me
mean
meanwhile
merely
might
more
moreover
most
mostly
much
must
my
myself
n
name
namely
nd
near
nearly
necessary
need
needs
neither
never
nevertheless
new
next
nine
no
nobody
non
none
noone
nor
normally
not
nothing
novel
now
nowhere
o
obviously
of
off
often
oh
ok
okay
old
on
once
one
ones
only
onto
or
other
others
otherwise
ought
our
ours
ourselves
out
outside
over
overall
own
p
particular
particularly
per
perhaps
placed
please
plus
possible
presumably
probably
provides
q
que
quite
qv
r
rather
rd
re
really
reasonably
regarding
regardless
regards
relatively
respectively
right
s
said
same
saw
say
saying
says
second
secondly
see
seeing
seem
seemed
seeming
seems
seen
self
selves
sensible
sent
serious
seriously
seven
several
shall
she
should
shouldn't
since
six
so
some
somebody
somehow
someone
something
sometime
sometimes
somewhat
somewhere
soon
sorry
specified
specify
specifying
still
sub
such
sup
sure
t
t's
take
taken
tell
tends
th
than
thank
thanks
thanx
that
that's
thats
the
their
theirs
them
themselves
then
thence
there
there's
thereafter
thereby
therefore
therein
theres
thereupon
these
they
they'd
they'll
they're
they've
think
third
this
thorough
thoroughly
those
though
three
through
throughout
thru
thus
to
together
too
took
toward
towards
tried
tries
truly
try
trying
twice
two
u
un
under
unfortunately
unless
unlikely
until
unto
up
upon
us
use
used
useful
uses
using
usually
uucp
v
value
various
very
via
viz
vs
w
want
wants
was
wasn't
way
we
we'd
we'll
we're
we've
welcome
well
went
were
weren't
what
what's
whatever
when
whence
whenever
where
where's
whereafter
whereas
whereby
wherein
whereupon
wherever
whether
which
while
whither
who
who's
whoever
whole
whom
whose
why
will
willing
wish
with
within
without
won't
wonder
would
would
wouldn't
x
y
yes
yet
you
you'd
you'll
you're
you've
your
yours
yourself
yourselves
z
zero

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<!-- By default, only the Clean and Build commands use this build script. -->
<!-- Commands such as Run, Debug, and Test only use this build script if -->
<!-- the Compile on Save feature is turned off for the project. -->
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
<!-- in the project's Project Properties dialog box.-->
<project name="Sistema_de_recuperacion_de_informacion" default="default" basedir=".">
<description>Builds, tests, and runs the project Sistema de recuperacion de informacion.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="Sistema_de_recuperacion_de_informacion-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

View File

@ -0,0 +1,8 @@
build.xml.data.CRC32=1bc330cf
build.xml.script.CRC32=cea675c0
build.xml.stylesheet.CRC32=28e38971@1.53.1.46
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=1bc330cf
nbproject/build-impl.xml.script.CRC32=788c3884
nbproject/build-impl.xml.stylesheet.CRC32=6ddba6b6@1.53.1.46

View File

@ -0,0 +1,4 @@
compile.on.save=true
file.reference.Jama-1.0.3.jar=D:\\_Adanay\\_Maestr\u00eda\\_Tesis\\_Tesis\\Proyecto ISL Java\\Libreria\\Jama-1.0.3.jar
file.reference.snowball-1.0.jar=D:\\_Adanay\\_Maestr\u00eda\\_Tesis\\_Tesis\\Proyecto ISL Java\\Libreria\\snowball-1.0.jar
user.properties.file=C:\\Users\\ADANAY\\AppData\\Roaming\\NetBeans\\7.2\\build.properties

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
</project-private>

View File

@ -0,0 +1,75 @@
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection transport:
#debug.transport=dt_socket
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/Sistema_de_recuperacion_de_informacion.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
file.reference.Jama-1.0.3.jar=D:\\Adanay\\_Maestr\u00eda\\_Tesis\\Proyecto ISL Java\\Libreria\\Jama-1.0.3.jar
file.reference.snowball-1.0.jar=D:\\ADANAY\\_Maestr\u00eda\\Biomatem\u00e1tica\\_Tesis\\Proyecto ISL Java\\Libreria\\snowball-1.0.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.Jama-1.0.3.jar}:\
${file.reference.snowball-1.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.processorpath=\
${javac.classpath}
javac.source=1.7
javac.target=1.7
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}
javac.test.processorpath=\
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=ISL.Principal
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project.
# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-prop.name=value:
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>Sistema de recuperacion de informacion</name>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots>
<root id="test.src.dir"/>
</test-roots>
</data>
</configuration>
</project>

View File

@ -0,0 +1,485 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fichero;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
import org.tartarus.snowball.ext.englishStemmer;
/**
*
* @author Adanay
*/
public class Coleccion {
private BufferedReader reader;
private ArrayList<String> Stopwords;
private ArrayList<Documento> LDocumentos;
private Consulta La_Consulta;
private ArrayList<Relevancia> LRelevancia;
private ArrayList<String> todos_terminos_doc_cons;
private int num_consulta;
private englishStemmer Stemming;
public Coleccion() {
reader = null;
Stopwords = new ArrayList<>();
La_Consulta = new Consulta(0, "");
LDocumentos = new ArrayList<>();
LRelevancia = new ArrayList<>();
todos_terminos_doc_cons = new ArrayList<>();
num_consulta = 0;
Stemming = new englishStemmer();
}
public ArrayList<Relevancia> getLRelevancia() {
return LRelevancia;
}
public void setLRelevancia(ArrayList<Relevancia> LRelevancia) {
this.LRelevancia = LRelevancia;
}
public int getNum_consulta() {
return num_consulta;
}
public void setNum_consulta(int num_consulta) {
this.num_consulta = num_consulta;
}
public ArrayList<Documento> getLDocumentos() {
return LDocumentos;
}
public Documento getLDocumentos(int pos) {
return LDocumentos.get(pos);
}
public void ConvertirFicheroRelevancia() {
try {
reader = new BufferedReader(new FileReader("D:\\MED_relevancia.txt"));
String Line = reader.readLine();
String cons_orig = "";
StringTokenizer rel = new StringTokenizer(Line);
while (Line != null) {
if ("".equals(cons_orig)) {
cons_orig = rel.nextToken();
}
ArrayList<String> Ldoc = new ArrayList<>();
Ldoc.add(rel.nextToken());
Line = reader.readLine();
rel = new StringTokenizer(Line);
String cons_sig = rel.nextToken();
while (cons_orig.equals(cons_sig)) {
Ldoc.add(rel.nextToken());
Line = reader.readLine();
if (Line != null) {
rel = new StringTokenizer(Line);
cons_sig = rel.nextToken();
} else {
break;
}
}
Relevancia miRel = new Relevancia(cons_orig, Ldoc);
LRelevancia.add(miRel);
cons_orig = cons_sig;
}
// Mostrar_Relevancia();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public void ConvertirFicheroStopword() {
try {
String Line;
reader = new BufferedReader(new FileReader("D:\\stopwords_en.txt"));
while ((Line = reader.readLine()) != null) {
// System.out.println(Line);
Stopwords.add(Line);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public void ConvertirFicheroDocumetos() {
try {
String Line;
reader = new BufferedReader(new FileReader("D:\\MED_doc.txt"));
String TexNew = reader.readLine();
while (TexNew != null) {
Line = TexNew;
Documento miDoc = new Documento("", "", "");
// System.out.println(Line);
StringTokenizer ide = new StringTokenizer(Line);
String a = ide.nextToken(); //toma .I
String b = ide.nextToken(); //toma el número que seria el identificador del doc
miDoc.setIdentificador(b);
Line = reader.readLine();
if (".T".equals(Line)) {
String titulo = reader.readLine();
Line = reader.readLine();
while (!(".A".equals(Line)) && !(".W".equals(Line))) {
titulo = titulo + " " + Line; // concatena tilulo con mas de una linea
Line = reader.readLine();
}
// System.out.println(titulo);
miDoc.setTitulo(titulo);
}
if (".A".equals(Line)) {
String autores = reader.readLine();
while (!".W".equals(Line = reader.readLine())) {
autores = autores + ", " + Line; // concatena todos los autores separados por ","
}
// System.out.println(autores);
miDoc.setAutor(autores);
}
if (".W".equals(Line)) {
Line = reader.readLine();
String texto = Line;
StringTokenizer tex = new StringTokenizer(texto);
String inicio = tex.nextToken();
while (!(".I".equals(inicio)) && (Line != null)) {
Line = reader.readLine();
if (Line != null) {
StringTokenizer tex1 = new StringTokenizer(Line);
inicio = tex1.nextToken();
if (!".I".equals(inicio)) {
texto = texto + " " + Line; // concatena el texto con mas de una linea
}
}
}
texto = texto.replaceAll("[^a-zA-Z_-]", " ");
// System.out.println(texto);
ArrayList<Termino> Term_Doc = Stopwords_Stemming_TermDobles(texto);
miDoc.setLTerminos(Term_Doc);
LDocumentos.add(miDoc);
// Mostrar_Terminos(Term_Doc);
TexNew = Line;
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public void ConvertirConsulta() {
try {
reader = new BufferedReader(new FileReader("D:\\MED_consulta.txt"));
String TexNew = reader.readLine();
La_Consulta.setIdentificador(num_consulta);
String Texto = "";
while (!"0".equals(TexNew) && TexNew != null) {
if (TexNew.equals(".I " + num_consulta)) {
reader.readLine(); // .W (etiqueta)
TexNew = reader.readLine();
String inicio = "";
while (!(".I".equals(inicio)) && (TexNew != null)) {
Texto = Texto + " " + TexNew; // concatena el texto con mas de una linea
TexNew = reader.readLine();
if (TexNew != null) {
StringTokenizer tex1 = new StringTokenizer(TexNew);
inicio = tex1.nextToken();
} else {
break;
}
}
TexNew = "0";
} else {
TexNew = reader.readLine();
}
}
La_Consulta.setConsulta(Texto);
Texto = Texto.replaceAll("[^a-zA-Z_-]", " ");
// System.out.println(texto);
ArrayList<Termino> Term_Cons = Stopwords_Stemming_TermDobles(Texto);
La_Consulta.setLTerminosC(Term_Cons);
// Mostrar_Terminos(Term_Cons);
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
public ArrayList Stopwords_Stemming_TermDobles(String texto) {
ArrayList<Termino> Lista_Temp = new ArrayList();
StringTokenizer texto_tok = new StringTokenizer(texto);
int cant_term = texto_tok.countTokens();
for (int i = 0; i < cant_term; i++) {
String palabra = texto_tok.nextToken();
boolean es_stopword = false;
for (int j = 0; j < Stopwords.size(); j++) { //comparando con todas las stopwords
String stopword = Stopwords.get(j);
if (palabra.equals(stopword)) {
es_stopword = true;
}
}
if (es_stopword == false) {
Stemming.setCurrent(palabra);
if (Stemming.stem()) {
Termino x = new Termino(Stemming.getCurrent(), 1);
Lista_Temp.add(x);
} else {
Termino x = new Termino(palabra, 1);
Lista_Temp.add(x);
}
}
}
Lista_Temp = Eliminar_TermDobles_CalcFrac(Lista_Temp);
return Lista_Temp;
}
public ArrayList Eliminar_TermDobles_CalcFrac(ArrayList<Termino> Todos) {
ArrayList<Termino> mis_terminos = Todos;
for (int i = 0; i < mis_terminos.size(); i++) {
String term1 = mis_terminos.get(i).getTermino();
for (int j = i + 1; j < mis_terminos.size(); j++) {
String term2 = mis_terminos.get(j).getTermino();
if (term1.equals(term2)) {
int frec = mis_terminos.get(i).getFrecuencia() + 1;
mis_terminos.get(i).setFrecuencia(frec);
mis_terminos.remove(j);
j--;
}
}
}
return mis_terminos;
}
public void Total_terminos_Doc_Cons() { //conforma una lista con todos los terminos de los doc y la consulta dada
for (int i = 0; i < LDocumentos.size(); i++) { //ciclo para los documentos
Documento unDoc = LDocumentos.get(i);
int cant_term_doc = unDoc.getLTerminos().size();
for (int j = 0; j < cant_term_doc; j++) { //ciclo para la lista de terminos en cada Doc
boolean existe_term = false;
String term_doc = unDoc.getLTerminos().get(j).getTermino();
if (i == 0) {
todos_terminos_doc_cons.add(term_doc);
} else {
for (int k = 0; k < todos_terminos_doc_cons.size(); k++) { //ciclo para verificar si ya está el term en la list del total de terminos
String term_list = todos_terminos_doc_cons.get(k);
if (term_doc.equals(term_list)) {
existe_term = true;
}
}
if (existe_term == false) {
todos_terminos_doc_cons.add(term_doc);
}
}
}
}
//Mostrar_Total_Terminos_Doc_Cons();
}
public double[][] Matriz_frecuencia_term() { //conforma la matriz a partir de todos terminos los doc y la cons seleccionada
int fila = todos_terminos_doc_cons.size();
int col = LDocumentos.size() + 1;
double[][] frecuencia_TxD = new double[fila][col];
for (int i = 0; i < todos_terminos_doc_cons.size(); i++) {
String term = todos_terminos_doc_cons.get(i);
for (int j = 0; j < LDocumentos.size(); j++) {
Documento actualDoc = LDocumentos.get(j);
int cant_term = actualDoc.getLTerminos().size();
int frec_term_doc = 0;
for (int k = 0; k < cant_term; k++) {
String term_doc = actualDoc.getLTerminos().get(k).getTermino();
if (term.equals(term_doc)) {
frec_term_doc = actualDoc.getLTerminos().get(k).getFrecuencia();
}
}
frecuencia_TxD[i][j] = frec_term_doc;
}
int cant_term_cons = La_Consulta.getLTerminosC().size();
int frec_term_cons = 0;
for (int m = 0; m < cant_term_cons; m++) {
String term_cons = La_Consulta.getLTerminosC().get(m).getTermino();
if (term.equals(term_cons)) {
frec_term_cons = La_Consulta.getLTerminosC().get(m).getFrecuencia();
}
}
int pos = col - 1;
frecuencia_TxD[i][pos] = frec_term_cons;
}
// Mostrar_frec_TxD(frecuencia_TxD);
return frecuencia_TxD;
}
//-----------------------------Para mostrar info por consola--------------------
public void Mostrar_Terminos(ArrayList<Termino> MyTerminos) {
for (int i = 0; i < MyTerminos.size(); i++) {
System.out.print(" ");
System.out.print(MyTerminos.get(i).getFrecuencia() + "--");
System.out.print(MyTerminos.get(i).getTermino());
}
System.out.println();
}
public void Mostrar_Total_Terminos_Doc_Cons() {
System.out.print(todos_terminos_doc_cons.size());
System.out.println();
for (int i = 0; i < todos_terminos_doc_cons.size(); i++) {
System.out.println();
System.out.print(todos_terminos_doc_cons.get(i));
}
}
public void Mostrar_frec_TxD(double[][] frecuencia_TxD) {
int fila = todos_terminos_doc_cons.size();
int col = LDocumentos.size() + 1; // incluye la columna de la consulta
System.out.print(fila + " x " + col);
for (int i = 0; i < fila; i++) {
// System.out.print(todos_terminos_doc_cons.get(i) + ": ");
for (int j = 0; j < col; j++) {
System.out.print(frecuencia_TxD[i][j]);
System.out.print(" ");
}
System.out.println();
}
}
public void Mostrar_frec_vector(double[] frecuencia_V) {
int fila = todos_terminos_doc_cons.size();
for (int j = 0; j < fila; j++) {
// System.out.print(todos_terminos_doc_cons.get(j) + ": ");
System.out.print(frecuencia_V[j]);
System.out.println();
}
System.out.println();
}
public void Mostrar_Relevancia() {
int cant = LRelevancia.size();
for (int i = 0; i < cant; i++) {
System.out.println(LRelevancia.get(i).getId_Cons() + ": ");
for (int j = 0; j < LRelevancia.get(i).getLista_doc().size(); j++) {
System.out.print(LRelevancia.get(i).getLista_doc().get(j) + "--");
}
System.out.println();
}
}
}

View File

@ -0,0 +1,51 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fichero;
import java.util.ArrayList;
/**
*
* @author Adanay
*/
public class Consulta {
private int identificador;
ArrayList<Termino> LTerminosC;
String consulta;
public Consulta(int identificador, String consulta) {
this.identificador = identificador;
this.consulta = consulta;
LTerminosC = new ArrayList<>();
}
public String getConsulta() {
return consulta;
}
public void setConsulta(String consulta) {
this.consulta = consulta;
}
public int getIdentificador() {
return identificador;
}
public ArrayList<Termino> getLTerminosC() {
return LTerminosC;
}
public void setIdentificador(int identificador) {
this.identificador = identificador;
}
public void setLTerminosC(ArrayList<Termino> LTerminosC) {
this.LTerminosC = LTerminosC;
}
}

View File

@ -0,0 +1,62 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fichero;
import java.util.ArrayList;
/**
*
* @author Adanay
*/
public class Documento {
private String identificador;
private String titulo;
private String autor;
private ArrayList<Termino>LTerminos;
public Documento(String identificador, String titulo, String autor) {
this.identificador = identificador;
this.titulo = titulo;
this.autor = autor;
LTerminos = new ArrayList<>();
}
public ArrayList<Termino> getLTerminos() {
return LTerminos;
}
public void setLTerminos(ArrayList<Termino> LTerminos) {
this.LTerminos = LTerminos;
}
public String getIdentificador() {
return identificador;
}
public void setIdentificador(String identificador) {
this.identificador = identificador;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getAutor() {
return autor;
}
public void setAutor(String autor) {
this.autor = autor;
}
}

View File

@ -0,0 +1,43 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fichero;
import java.util.ArrayList;
/**
*
* @author ADANAY
*/
public class Relevancia {
private String id_Cons;
private ArrayList<String>Lista_doc;
public Relevancia(String id_Cons, ArrayList<String> Ldoc) {
this.id_Cons = id_Cons;
this.Lista_doc = Ldoc;
}
public String getId_Cons() {
return id_Cons;
}
public ArrayList<String> getLista_doc() {
return Lista_doc;
}
public void setLista_doc(ArrayList<String> Lista_doc) {
this.Lista_doc = Lista_doc;
}
public void setId_Cons(String id_Cons) {
this.id_Cons = id_Cons;
}
}

View File

@ -0,0 +1,40 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Fichero;
/**
*
* @author ADANAY
*/
public class Termino {
private String termino;
private int frecuencia;
public Termino(String termino, int frecuencia) {
this.termino = termino;
this.frecuencia = frecuencia;
}
public String getTermino() {
return termino;
}
public void setTermino(String termino) {
this.termino = termino;
}
public int getFrecuencia() {
return frecuencia;
}
public void setFrecuencia(int frecuencia) {
this.frecuencia = frecuencia;
}
}

View File

@ -0,0 +1,523 @@
package ISL;
import Jama.*;
public class ISL {
private Matrix Matriz_inicial;
private Matrix Matriz_TxD;
private int T;
private int D;
private Matrix U;
private Matrix S;
private Matrix Vt;
private SingularValueDecomposition SVD;
private Matrix Uk;
private Matrix Sk;
private Matrix Vk;
private Matrix Consulta;
private Matrix q;
private double distancia[];
public ISL(double a[][], int F, int C) {
this.T = F;
this.D = C - 1;
Matriz_inicial = new Matrix(a);
Matriz_TxD = new Matrix(T, D);
Consulta = new Matrix(1, F);
}
public double getDistancia(int pos) {
return distancia[pos];
}
public void Calcular_peso() {
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
Matrix LG = G_tf_x_idf();
// Matrix G = G_Entropia();
/* for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
double valorG = G.get(i, 0);
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
double valorL = L.get(i, j);
double W = valorL * valorG;
Matriz_temp.set(i, j, W);
}
}*/
Matrix W = N_Coseno_Normalizacion(LG);
Asignar_Valores_Matriz_TxD_Consulta(W);
}
//------------Funciones de peso local------------------
public Matrix L_Maxima_Normalizacion() {
double tf;
double resultado;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
double tfmax = 0;
tf = Matriz_inicial.get(i, j);
for (int h = 0; h < Matriz_inicial.getRowDimension(); h++) {
if (Matriz_inicial.get(h, j) > tfmax) {
tfmax = Matriz_inicial.get(h, j);
}
}
if (tfmax != 0) {
resultado = tf / tfmax;
} else {
resultado = 0;
}
Matriz_temp.set(i, j, resultado);
}
}
//Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
//Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
public Matrix L_Maxima_Normalizacion_Aumentada() {
double tf;
double resultado;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
double tfmax = 0;
tf = Matriz_inicial.get(i, j);
for (int h = 0; h < Matriz_inicial.getRowDimension(); h++) {
if (Matriz_inicial.get(h, j) > tfmax) {
tfmax = Matriz_inicial.get(h, j);
}
}
if (tfmax != 0) {
resultado = 0.5 + (0.5 * (tf / tfmax));
} else {
resultado = 0;
}
Matriz_temp.set(i, j, resultado);
}
}
// Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
public Matrix L_Normalizacion_log() {
double tf;
double resultado;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
tf = Matriz_inicial.get(i, j);
if (tf != 0) { // Verifico porque si es =0 me da NAN o infinito
resultado = Math.log10(tf) + 1;
} else {
resultado = 0;
}
Matriz_temp.set(i, j, resultado);
}
}
// Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
public Matrix L_Normalizacion_Promedio() {
double tf;
double resultado;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
double promediotf;
double suma = 0;
tf = Matriz_inicial.get(i, j);
for (int h = 0; h < Matriz_inicial.getRowDimension(); h++) {
if (h != i) {
suma = suma + Matriz_inicial.get(h, j);
}
}
if (tf != 0 && suma != 0) { // Verifico porque si es =0 me da NAN o infinito
promediotf = suma / (T - 1);
resultado = (1 + Math.log10(tf)) / (1 + Math.log10(promediotf));
} else {
resultado = 0;
}
Matriz_temp.set(i, j, resultado);
}
}
//Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
//-----------Funciones de Peso Global---------------------------------------
public Matrix G_tf_x_idf() {
double tf;
double idf;
double resultado;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) { // tranformar la matriz
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
int n = 0;
tf = Matriz_inicial.get(i, j);
for (int h = 0; h < Matriz_inicial.getColumnDimension(); h++) {
if (Matriz_inicial.get(i, h) != 0) {
n++;
}
}
if (n != 0) {
idf = Math.log(D / n);
} else {
idf = 0;
}
resultado = tf * idf;
Matriz_temp.set(i, j, resultado);
}
}
return Matriz_temp;
// Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
}
public Matrix G_idf() {
double tf;
double idf;
int fila = Matriz_inicial.getRowDimension();
int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, 1);
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) { // tranformar la matriz
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
int n = 0;
tf = Matriz_inicial.get(i, j);
for (int h = 0; h < Matriz_inicial.getColumnDimension(); h++) {
if (Matriz_inicial.get(i, h) != 0) {
n++;
}
}
if (n != 0) {
idf = Math.log(D / n);
} else {
idf = 0;
}
Matriz_temp.set(i, 0, idf);
}
}
return Matriz_temp;
// Asignar_Valores_Matriz_TxD_Consulta(Matriz_temp);
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
}
public Matrix G_Entropia() {
double tf;
double F;
double entropia;
double sumatoria;
int fila = Matriz_inicial.getRowDimension();
// int col = Matriz_inicial.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, 1);
for (int i = 0; i < Matriz_inicial.getRowDimension(); i++) {
sumatoria = 0;
F = 0;
for (int h = 0; h < Matriz_inicial.getColumnDimension(); h++) {
F = F + Matriz_inicial.get(i, h);
}
for (int j = 0; j < Matriz_inicial.getColumnDimension(); j++) {
tf = Matriz_inicial.get(i, j);
if (tf != 0) {
sumatoria = sumatoria + ((tf / F) * Math.log10(tf / F)) / Math.log10(D);
}
}
entropia = 1 + sumatoria;
Matriz_temp.set(i, 0, entropia);
}
//Mostrar(Matriz_TxD, Matriz_TxD.getRowDimension(), Matriz_TxD.getColumnDimension());
return Matriz_temp;
}
//--------Funciones de Normalizacion--------------------------------------------
public Matrix N_Coseno_Normalizacion(Matrix Matriz_LG) {
double resultado;
double normalizacion;
int fila = Matriz_LG.getRowDimension();
int col = Matriz_LG.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int j = 0; j < Matriz_LG.getColumnDimension(); j++) {
double suma = 0;
for (int i = 0; i < Matriz_LG.getRowDimension(); i++) {
suma = suma + Math.pow(Matriz_LG.get(i, j), 2);
}
if (suma != 0) { // Verifico porque si es =0 me da NAN o infinito
normalizacion = 1 / Math.sqrt(suma);
} else {
normalizacion = 0;
}
for (int i = 0; i < Matriz_LG.getRowDimension(); i++) {
double term = Matriz_LG.get(i, j);
resultado = term * normalizacion;
Matriz_temp.set(i, j, resultado);
}
}
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
public Matrix N_Pivote_Normalizacion(Matrix Matriz_LG) {
double resultado;
double pivote;
double b_old;
double normalizacion;
int fila = Matriz_LG.getRowDimension();
int col = Matriz_LG.getColumnDimension();
Matrix Matriz_temp = new Matrix(fila, col);
for (int j = 0; j < Matriz_LG.getColumnDimension(); j++) {
double suma = 0;
double suma_2 = 0;
int cant = 0;
for (int i = 0; i < Matriz_LG.getRowDimension(); i++) {
suma_2 = suma_2 + Math.pow(Matriz_LG.get(i, j), 2);
if (Matriz_inicial.get(i, j) != 0) {
suma = suma + Matriz_LG.get(i, j);
cant++;
}
}
pivote = suma / cant;
if (suma_2 != 0) { // Verifico porque si es =0 me da NAN o infinito
b_old = Math.sqrt(suma_2);
} else {
b_old = 0;
}
normalizacion = 1 / ((0.2 * b_old) + (1 - 0.2) * pivote);
for (int i = 0; i < Matriz_LG.getRowDimension(); i++) {
double term = Matriz_LG.get(i, j);
resultado = term * normalizacion;
Matriz_temp.set(i, j, resultado);
}
}
// Mostrar(Matriz_temp, Matriz_temp.getRowDimension(), Matriz_temp.getColumnDimension());
return Matriz_temp;
}
//--------Descomposicion en valores singulares------subespacio K----------------
public void MatrizU() {
SVD = new SingularValueDecomposition(Matriz_TxD);// aqui tengo que entrar la matriz ya normalizada TxD
U = SVD.getU();
// Mostrar(U, U.getRowDimension(), U.getColumnDimension());
}
public void MatrizUk(int k) {
Uk = new Matrix(U.getRowDimension(), k);
for (int i = 0; i < U.getRowDimension(); i++) {
for (int j = 0; j < k; j++) {
Uk.set(i, j, U.get(i, j));
}
}
// Mostrar(Uk, U.getRowDimension(), k);
}
public void MatrizS() {
S = SVD.getS();
// Mostrar(S, S.getRowDimension(), S.getColumnDimension());
}
public void MatrizSk(int k) {
Sk = new Matrix(k, k);
for (int i = 0; i < k; i++) {
for (int j = 0; j < k; j++) {
Sk.set(i, j, S.get(i, j));
}
}
//Mostrar(Sk, k, k);
}
public void MatrizV() {
Vt = SVD.getV().transpose();
// Mostrar(Vt, Vt.getRowDimension(), Vt.getColumnDimension());
}
public void MatrizVk(int k) {
Vk = new Matrix(k, Vt.getColumnDimension());
for (int i = 0; i < k; i++) {
for (int j = 0; j < Vt.getColumnDimension(); j++) {
Vk.set(i, j, Vt.get(i, j));
}
}
//Mostrar(Vk, Vk.getRowDimension(), Vk.getColumnDimension());
}
//------------------Consulta----------------------------------------------------
public void TransformarVectorConsulta() {
Matrix a = Consulta.times(Uk);
q = a.times(Sk.inverse());
// Mostrar(q, q.getRowDimension(), q.getColumnDimension());
}
public double[] Distancia() {
int fila = Vk.getRowDimension();
int col = Vk.getColumnDimension();
distancia = new double[col];
for (int j = 0; j < col; j++) {
Matrix columnaVk = Vk.getMatrix(0, fila - 1, j, j);
Matrix mult_qxcolumnaVk = q.times(columnaVk);
double q_x_columnaVk = mult_qxcolumnaVk.get(0, 0);
double norma_q = q.normF();
double norma_columnaVk = columnaVk.normF();
distancia[j] = q_x_columnaVk / (norma_q * norma_columnaVk);
}
Matrix A = new Matrix(distancia, 1);
// Mostrar(A, A.getRowDimension(), A.getColumnDimension());
return distancia;
}
//------------LLenar las Matrices----------------------------------------------
public void Asignar_Valores_Matriz_TxD_Consulta(Matrix Matriz1) {
int col = Matriz1.getColumnDimension() - 1;
int fila = Matriz1.getRowDimension();
for (int j = 0; j < col; j++) {
for (int i = 0; i < fila; i++) {
double valor = Matriz1.get(i, j);
Matriz_TxD.set(i, j, valor);
}
}
for (int i = 0; i < fila; i++) {
double valor = Matriz1.get(i, col);
Consulta.set(0, i, valor);
}
// Mostrar(Matriz_TxD, Matriz_TxD.getRowDimension(), Matriz_TxD.getColumnDimension());
// Mostrar(Consulta, Consulta.getRowDimension(), Consulta.getColumnDimension());
}
//-----Para Mostrar los resultados----------------------------------------------
public void Mostrar(Matrix A, int fila, int col) {
System.out.println();
System.out.println();
for (int i = 0; i < fila; i++) {
for (int j = 0; j < col; j++) {
System.out.print(A.get(i, j));
System.out.print(" ");
}
System.out.println();
}
}
}

View File

@ -0,0 +1,140 @@
package ISL;
import Fichero.*;
import java.util.ArrayList;
import java.util.Scanner;
public class Principal {
private static Coleccion MiColeccion;
private static ISL MiMatriz;
private static ArrayList<Resultado> LResultados;
public static void main(String[] args) {
Scanner consola = new Scanner(System.in);
// System.out.print("Entre el num de la pregunta (1-35): ");
// int num_cons = consola.nextInt();
for (int cons = 1; cons <= 19; cons++) {
MiColeccion = new Coleccion();
LResultados = new ArrayList<>();
MiColeccion.ConvertirFicheroStopword();
MiColeccion.ConvertirFicheroRelevancia();
MiColeccion.ConvertirFicheroDocumetos();
System.out.println("Consulta : " + cons);
System.out.println();
MiColeccion.setNum_consulta(cons);
MiColeccion.ConvertirConsulta();
MiColeccion.Total_terminos_Doc_Cons();
double[][] matriz_txd = MiColeccion.Matriz_frecuencia_term(); //
int filas;
filas = matriz_txd.length;
MiMatriz = new ISL(matriz_txd, filas, 551);
MiMatriz.Calcular_peso();
MiMatriz.MatrizU();
MiMatriz.MatrizS();
MiMatriz.MatrizV();
int k = 20;
MiMatriz.MatrizUk(k);
MiMatriz.MatrizSk(k);
MiMatriz.MatrizVk(k);
MiMatriz.TransformarVectorConsulta();
MiMatriz.Distancia();
Lista_Resultado_Ordenado();
Calcular_Doc_Rel_Recup();
//----PAra calcular Presicion Exhaustividad y Medida F
float doc_relev_recup = 0;
float doc_recup = LResultados.size();
int pos = MiColeccion.getNum_consulta() - 1;
Relevancia MisDocsRel = MiColeccion.getLRelevancia().get(pos);
float doc_relev = MisDocsRel.getLista_doc().size();
for (int i = 0; i < doc_recup; i++) {
for (int j = 0; j < MisDocsRel.getLista_doc().size(); j++) {
if (LResultados.get(i).getDoc().getIdentificador().equals(MisDocsRel.getLista_doc().get(j))) {
doc_relev_recup++;
}
}
}
System.out.println("doc relevantes: " + doc_relev);
System.out.println("doc relevantes recuperados: " + doc_relev_recup);
System.out.println("doc recuperados: " + doc_recup);
int B = 1;
float exhaustividad = (doc_relev_recup) / (doc_relev);
float precision = doc_relev_recup / doc_recup;
double medida_F = ((Math.pow(B, 2) + 1) * precision * exhaustividad) / ((Math.pow(B, 2) * precision) + exhaustividad);
System.out.println("Precision: " + precision);
System.out.println("Cobertura: " + exhaustividad);
System.out.println("Medida-F: " + medida_F);
System.out.println();
System.out.println("-------------------------------------------------------");
System.out.println();
}
}
public static void Lista_Resultado_Ordenado() {
LResultados = new ArrayList<>();
for (int i = 0; i < MiColeccion.getLDocumentos().size(); i++) {
if (MiMatriz.getDistancia(i) > 0.5) { //Se recuperan los que la distancia sea > 0 (umbral)
Resultado unResult = new Resultado(MiColeccion.getLDocumentos(i), MiMatriz.getDistancia(i));
LResultados.add(unResult);
}
}
for (int j = 0; j < LResultados.size() - 1; j++) { // ordena los resultados de mayor a menor
for (int k = j + 1; k < LResultados.size(); k++) {
if (LResultados.get(j).getSimilitud() < LResultados.get(k).getSimilitud()) {
Resultado resul_temp1 = LResultados.get(j);
Resultado resul_temp2 = LResultados.get(k);
LResultados.set(j, resul_temp2);
LResultados.set(k, resul_temp1);
}
}
}
//Mostrar_Result();
}
public static void Mostrar_Result() {
for (int k = 0; k < LResultados.size(); k++) {
System.out.print(LResultados.get(k).getDoc().getIdentificador() + ": ");
System.out.println();
System.out.print(LResultados.get(k).getSimilitud());
System.out.println();
System.out.println();
}
}
public static void Calcular_Doc_Rel_Recup() {
}
}

View File

@ -0,0 +1,40 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ISL;
import Fichero.Documento;
/**
*
* @author ADANAY
*/
public class Resultado {
private Documento Doc;
private double similitud;
public Resultado(Documento Doc, double similitud) {
this.Doc = Doc;
this.similitud = similitud;
}
public Documento getDoc() {
return Doc;
}
public void setDoc(Documento Doc) {
this.Doc = Doc;
}
public double getSimilitud() {
return similitud;
}
public void setSimilitud(double similitud) {
this.similitud = similitud;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 KiB

View File

@ -0,0 +1,32 @@
========================
BUILD OUTPUT DESCRIPTION
========================
When you build an Java application project that has a main class, the IDE
automatically copies all of the JAR
files on the projects classpath to your projects dist/lib folder. The IDE
also adds each of the JAR files to the Class-Path element in the application
JAR files manifest file (MANIFEST.MF).
To run the project from the command line, go to the dist folder and
type the following:
java -jar "Modelo_matem_tico.jar"
To distribute this project, zip up the dist folder (including the lib folder)
and distribute the ZIP file.
Notes:
* If two JAR files on the project classpath have the same name, only the first
JAR file is copied to the lib folder.
* Only JAR files are copied to the lib folder.
If the classpath contains other types of files or folders, these files (folders)
are not copied.
* If a library on the projects classpath also has a Class-Path element
specified in the manifest,the content of the Class-Path element has to be on
the projects runtime path.
* To set a main class in a standard Java project, right-click the project node
in the Projects window and choose Properties. Then click Run and enter the
class name in the Main Class field. Alternatively, you can manually type the
class name in the manifest Main-Class element.

View File

@ -0,0 +1,3 @@
-Instalar el PostgresSQL.
-Cargar la base de datos(taxonomia.backup).
-Copiar la carpeta openCV en C:\\