Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
qparse
qparselib
Commits
858113d1
Commit
858113d1
authored
Apr 24, 2021
by
Florent Jacquemard
Browse files
update KeySV (for target equiv with value list) to simplified version of keys.
parent
e1f4a303
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
qparse.xcodeproj/project.pbxproj
View file @
858113d1
...
...
@@ -192,7 +192,6 @@
43004667260496E6000E9898
/* PSConfig.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4348EA3E25DA77C60037B9BC
/* PSConfig.cpp */
;
};
43004668260496E6000E9898
/* TreePosition.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43E2728C2315696C000D2DF4
/* TreePosition.cpp */
;
};
43004669260496E6000E9898
/* InputSegmentSpiral.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4391F02323E9D99F004A91D6
/* InputSegmentSpiral.cpp */
;
};
4300466A260496E6000E9898
/* squant2.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
432E54AE224E3DF50031E9C6
/* squant2.cpp */
;
};
4300466C260496E6000E9898
/* libmei.dylib in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43A02320203F3E3B000345AB
/* libmei.dylib */
;
};
430046CD26049AEC000E9898
/* squant2.2.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
430046CC26049AEC000E9898
/* squant2.2.cpp */
;
};
4303A2AD1FA299FB0087128D
/* Binasc.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3448BD251F0A484500B49FB8
/* Binasc.cpp */
;
};
...
...
@@ -387,6 +386,11 @@
4332790F260E450C00D6AD17
/* KeyS.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4373B456225163CC00D49D6C
/* KeyS.cpp */
;
};
433DA74925EEA62100144F63
/* RewriteMulti.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
433DA74725EEA62100144F63
/* RewriteMulti.cpp */
;
};
43448D5F25097627007ECBA5
/* ScoreBuilder.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43467766247AB20F008A146B
/* ScoreBuilder.cpp */
;
};
4345A544263410EE00297B18
/* RunTerm.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
430046E42604CF3F000E9898
/* RunTerm.cpp */
;
};
4345A5502634111100297B18
/* RunInnero.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43631EC826186E7C004CC60F
/* RunInnero.cpp */
;
};
4345A55C2634111900297B18
/* Runey.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43C573C8224D2FD3003FA990
/* Runey.cpp */
;
};
4345A5682634117F00297B18
/* Recordo.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43631EAF26186DAF004CC60F
/* Recordo.cpp */
;
};
4345A574263411AA00297B18
/* RunCompare.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4313D8DD2613231800702519
/* RunCompare.cpp */
;
};
43468B442523678E006D45B7
/* WeightDom.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43847D7923F55D2A00059835
/* WeightDom.cpp */
;
};
43468B452523678E006D45B7
/* SymbLabel.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
3291851C1DBE1DD2008FFE31
/* SymbLabel.cpp */
;
};
43468B77252367D9006D45B7
/* DuraList.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43C7232F2362E2D800D5E20E
/* DuraList.cpp */
;
};
...
...
@@ -656,7 +660,6 @@
43CEBE3525DAA6DF005FA9AE
/* Transition.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4303B6D7229DE4B9003A91DF
/* Transition.cpp */
;
};
43CEBE3625DAA6DF005FA9AE
/* SWTA.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4356DABD22A45C8200E34F26
/* SWTA.cpp */
;
};
43CEBE4125DAA750005FA9AE
/* ParsingEnv.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
437FA6F722F97709003974DC
/* ParsingEnv.cpp */
;
};
43CEBE4225DAA750005FA9AE
/* Ranked.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43552ED322A6ADA800C557BA
/* Ranked.cpp */
;
};
43CEBE4325DAA750005FA9AE
/* RunFilterMode.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
43847D7D23F5980C00059835
/* RunFilterMode.cpp */
;
};
43CEBE4425DAA750005FA9AE
/* RunFilter.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
439EA0BA224CCF91006E742E
/* RunFilter.cpp */
;
};
43CEBEF925DAB9A4005FA9AE
/* KeyS.cpp in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4373B456225163CC00D49D6C
/* KeyS.cpp */
;
};
...
...
@@ -3253,7 +3256,6 @@
43004667260496E6000E9898
/* PSConfig.cpp in Sources */
,
43004668260496E6000E9898
/* TreePosition.cpp in Sources */
,
43004669260496E6000E9898
/* InputSegmentSpiral.cpp in Sources */
,
4300466A260496E6000E9898
/* squant2.cpp in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -3643,7 +3645,6 @@
43CEBE1A25DAA69B005FA9AE
/* SWTAFileIn.cpp in Sources */
,
43CEBE4125DAA750005FA9AE
/* ParsingEnv.cpp in Sources */
,
43CEBEF925DAB9A4005FA9AE
/* KeyS.cpp in Sources */
,
43CEBE4225DAA750005FA9AE
/* Ranked.cpp in Sources */
,
43CEBE4325DAA750005FA9AE
/* RunFilterMode.cpp in Sources */
,
43CEBE4425DAA750005FA9AE
/* RunFilter.cpp in Sources */
,
43CEBF0825DABA3D005FA9AE
/* Event.cpp in Sources */
,
...
...
@@ -3655,6 +3656,7 @@
43CEBF0E25DABA3D005FA9AE
/* Score.cpp in Sources */
,
43CEBF0F25DABA3D005FA9AE
/* MeasureStack.cpp in Sources */
,
43CEBF1025DABA3D005FA9AE
/* MeasureStacked.cpp in Sources */
,
4345A5502634111100297B18
/* RunInnero.cpp in Sources */
,
43CEBF1125DABA3D005FA9AE
/* Part.cpp in Sources */
,
43A94D2425F7BC5400250CEF
/* LRTFileOut.cpp in Sources */
,
43CEBF1225DABA3D005FA9AE
/* PartEng.cpp in Sources */
,
...
...
@@ -3684,6 +3686,7 @@
43CEBF2925DABA3D005FA9AE
/* Root.cpp in Sources */
,
43CEBF2A25DABA3D005FA9AE
/* Tuplet.cpp in Sources */
,
43CEBF2B25DABA3D005FA9AE
/* Decorated.cpp in Sources */
,
4345A544263410EE00297B18
/* RunTerm.cpp in Sources */
,
43CEBF2C25DABA3D005FA9AE
/* Leaf.cpp in Sources */
,
43CEBF2D25DABA3D005FA9AE
/* Continuation.cpp in Sources */
,
43CEBF2E25DABA3D005FA9AE
/* Tied.cpp in Sources */
,
...
...
@@ -3705,11 +3708,13 @@
43CEBF3E25DABA3E005FA9AE
/* Local.cpp in Sources */
,
43CEBF3F25DABA3E005FA9AE
/* Articulation.cpp in Sources */
,
43CEBF4025DABA3E005FA9AE
/* Mordent.cpp in Sources */
,
4345A55C2634111900297B18
/* Runey.cpp in Sources */
,
43CEBF4125DABA3E005FA9AE
/* Gruppetto.cpp in Sources */
,
43CEBF4225DABA3E005FA9AE
/* LocalTrill.cpp in Sources */
,
43CEBF4325DABA3E005FA9AE
/* Dynamic.cpp in Sources */
,
43CEBF4425DABA3E005FA9AE
/* Jump.cpp in Sources */
,
43CEBF4525DABA3E005FA9AE
/* Fermata.cpp in Sources */
,
4345A5682634117F00297B18
/* Recordo.cpp in Sources */
,
43CEBF4625DABA3E005FA9AE
/* Breath.cpp in Sources */
,
43CEBF4725DABA3E005FA9AE
/* ClefChange.cpp in Sources */
,
43CEBF4825DABA3E005FA9AE
/* TempoChange.cpp in Sources */
,
...
...
@@ -3726,6 +3731,7 @@
43CEBF5225DABA3E005FA9AE
/* Glissando.cpp in Sources */
,
43CEBF5325DABA3E005FA9AE
/* Osc.cpp in Sources */
,
4352BE2F25E40EF600F045BC
/* KeySV.cpp in Sources */
,
4345A574263411AA00297B18
/* RunCompare.cpp in Sources */
,
43CEBF5425DABA3E005FA9AE
/* ScoreBuilder.cpp in Sources */
,
43CEBF5525DABA3E005FA9AE
/* ScoringEnv.cpp in Sources */
,
43CEBF5625DABA3E005FA9AE
/* SMVisitor.cpp in Sources */
,
...
...
src/V2.2/parsing/Ranked.cpp
View file @
858113d1
//
// Ranked.
t
pp
// Ranked.
c
pp
// squanty
//
// Created by Florent Jacquemard on 04/06/2019.
...
...
src/parsing/KeySI.cpp
View file @
858113d1
...
...
@@ -197,7 +197,7 @@ _interval(k._interval)
KeySI
::~
KeySI
()
{
TRACE
(
"delete KeySI
"
);
TRACE
(
"delete KeySI
{}"
,
*
this
);
// interval tree is deleted with the Parsing Env.
}
...
...
src/parsing/KeySV.cpp
View file @
858113d1
This diff is collapsed.
Click to expand it.
src/parsing/KeySV.hpp
View file @
858113d1
...
...
@@ -29,13 +29,13 @@ namespace parsing{
//template<class K> class Run;
/// Key (augmented SWTA state) made of
/// - one state of a base WTA
/// - one quantified interval = sequence of rationals (inherited attribute)
class
KeySV
:
public
KeyS
// Key<KeySI>
class
KeySV
:
public
KeyS
{
friend
class
KeySVHasher
;
template
<
typename
>
friend
class
RunFactory
;
public:
...
...
@@ -45,6 +45,19 @@ public:
/// @param env input environment.
KeySV
(
const
ValueList
&
seg
,
const
ParsingEnv
&
env
);
/// @brief constructor of a successor of a key to complete an inner run.
/// @param k target key for the run. can be partial.
/// @param r an inner run to be completed with the key constructed.
/// @param env input environment.
/// There are 4 cases of construction:
/// - if r is partial and empty, construct the first child k0 to add to r.
/// k is the parent of k0 in this case.
/// - if r is partial but not empty, construct the next sibling kn to add
/// to r. k is the parent of kn in this case.
/// - if r is inner and complete, construct a complete instance of k
/// that will be the (complete) target of run r.
KeySV
(
const
KeySV
&
k
,
RunInner
<
KeySV
>&
r
,
const
ParsingEnv
&
env
);
// internal
// @param s initial state of the base WTA.
// KeySV(state_t s, const ValueList& seg, const ParsingEnv& env);
...
...
@@ -52,68 +65,44 @@ public:
/// @brief copy constructor.
KeySV
(
const
KeySV
&
k
);
/// destructor
virtual
~
KeySV
();
/// @brief Key assignement.
virtual
KeySV
&
operator
=
(
const
KeySV
&
k
);
/// @brief constructor of first child.
/// construct a partial key to be instanciated as the first child of parent
/// in the body of an augmented transition.
/// @param parent head key of the augmented transition.
/// partial or complete.
/// inner must be true for parent key.
/// @param tr WTA transition, augmented by the transition partially
/// constructed here. must be inner.
/// @param env input environment.
KeySV
(
const
KeySV
&
parent
,
const
Transition
&
tr
,
const
ParsingEnv
&
env
);
/// @brief constructor for building next sibling.
/// construct a partial key to be instanciated as sibling
/// in the body of an augmented transition.
/// @param previous previous sibling of this key in the body of the
/// augmented transition. must be complete.
/// @param i position of the next sibling in body, in 1..arity-1
/// (0 is the position of the first child).
/// @param parent head key of the augmented transition
/// partial or complete.
/// @param tr SWTA transition, augmented by the transition partially
/// constructed here.
/// @param env input environment.
KeySV
(
const
KeySV
&
previous
,
size_t
i
,
const
KeySV
&
parent
,
const
Transition
&
tr
,
const
ParsingEnv
&
env
);
/// @brief constructor of complete instance.
/// construct a complete upgrade of the head key, by copy,
/// to be the head of an augmented transition.
/// @param head a key to be instanciated. must be partial.
/// @param a label of the augmented transition.
/// @param lastchild last child in the body of the augmented transition.
/// must be complete.
/// @param env input environment.
/// @warning should not be called for this class (head must be partial).
/// @see Key::instanciate
KeySV
(
const
KeySV
&
head
,
label_t
a
,
const
KeySV
&
lastchild
,
const
ParsingEnv
&
env
);
/// @brief for use as key in a unordered_multimap.
virtual
bool
operator
==
(
const
KeySV
&
p
)
const
;
virtual
bool
operator
!=
(
const
KeySV
&
p
)
const
;
/// @brief return wether this Key is an instance of p.
/// = equality in this case because KeyS are always complete.
virtual
bool
instance
(
const
KeySV
&
p
)
const
;
/// @brief all attributes of the key are valued
virtual
bool
complete
()
const
;
/// @brief accessor
/// sequence of IOI (rationals) associated to this state.
virtual
const
ValueList
&
value
()
const
{
return
_list
;
}
/// @brief construct (augmented) runs targeting complete instances of
/// this key.
/// @param si a stack to be filled with inner runs. must be empty.
/// @param st a stack to be filled with pairs containing terminal runs.
/// must be empty.
/// @param env parsing environment, containing a wta.
// @return how many runs have been added to the stacks.
/// @warning the runs constructed are added to the given stacks.
/// - si will contain inner runs, partial or complete.
/// - st will contains pairs made of
/// - a complete instance k' of k if k is partial, and NULL otherwise.
/// - a complete terminal run targeting r'
/// All the runs in stacks must be deallocate elsewhere.
void
runs
(
std
::
stack
<
RunInner
<
KeySV
>*>&
si
,
std
::
stack
<
std
::
pair
<
const
KeySV
*
,
RunTerm
*>>&
st
,
ParsingEnv
&
env
)
const
;
/// @brief constructor of complete instance for a leaf.
/// @param head a key to instanciate as leaf. must be partial
/// @param a label of the augmented transition. must be terminal.
/// @param env parsing environment.
/// @warning should not be called on this class (head must be partial)
/// @warning leaf for head, with same args, must return 1.
KeySV
(
const
KeySV
&
head
,
label_t
a
,
const
ParsingEnv
&
env
);
/// destructor
virtual
~
KeySV
();
/// allocate and return a special Run representing a parse failure for this key.
/// @param env parsing environment.
/// @return a pointer to a newly allocated fail run, with
...
...
@@ -122,100 +111,21 @@ public:
/// - fail symbol
/// - weight one (in the domain of the base wta).
/// This returned run will answer succesfully to Run.fail().
Run
<
KeySV
>*
failRun
(
const
ParsingEnv
&
env
)
const
;
// std::shared_ptr<Run<KeySV>> failRun_one(const ParsingEnv& env) const;
/// @brief number of leaf instances that can be obtained
/// from this key and the given args.
/// @param tr a SWTA transition, augmented by the transition partially
/// constructed here. must be nullary (leaf, terminal).
/// @param env parsing environment.
/// @return - 0 if there no leaf instance compatible with tr.
/// if this key is complete, it means that it is not compatible
/// with tr, a, and env.
/// - 1 if there is exactly one leaf instance of this key compatible
/// with tr, a and env.
/// if this key is complete, it means that it is compatible
/// with tr, a, and env.
/// if this key is partial, the leaf constructor can be use
/// to built the compatible instance.
/// can be used instead of Key::leaf.
/// - 2 if there are 2 or more leaf instances compatible with tr.
/// it means that this key is partial, the compatible instances
/// can be built with leaves.
virtual
size_t
leaf
(
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
// /// @brief completion of this partial leaf key to be the head
// /// of a nullary (leaf) transition augmenting tr.
// /// Build and store in the given queue q
// /// all ther new complete instances of this key,
// /// using the parsing environment env.
// /// @param tr a SWTA transition, augmented by the transition partially
// /// constructed here. must be nullary (leaf, terminal).
// /// @param env parsing environment.
// /// @param q empty queue used to store the complete instances.
// /// @warning this Key must be partial.
virtual
void
leaves
(
const
Transition
&
tr
,
const
ParsingEnv
&
env
,
std
::
queue
<
KeySV
>&
q
)
const
;
RunTerm
*
failRun
(
const
ParsingEnv
&
env
)
const
;
/// Best label of terminal transition augmenting tr targeted to this key.
/// @param tr a SWTA transition, possibly unlabelled or partialy labelled
/// @param env parsing environment.
/// @return the label maximizing the weight function for this label,
/// this transition, this env.
/// @warning this key must be complete.
virtual
label_t
label
(
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
/// @brief The weight of an augmented transition headed by an instance
/// of this Key (augmented state) and augmenting tr.
/// @param a label for the augmented transition.
/// @param tr SWTA transition, augmented by the transition partially
/// constructed here.
/// allocate and return a special Run representing a parse failure for this key.
/// @param env parsing environment.
/// @return the weight of a transition headed by an instance of this key
/// and augmenting tr.
/// @return a returned weight of zero (absorbing in the semiring)
/// indicates incompatibility between this key and the transition.
/// @warning if tr is nullary (leaf), this key must be complete.
/// @warning if tr is not nullary (inner), this key can be partial or complete.
/// @warning The weight of a run headed by the augmented transition
/// is the semiring product of this value with the product
/// of weights of the subruns.
/// @todo complete this stub with Distance
/// @see Key::weight
virtual
Weight
weight
(
label_t
a
,
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
/// @brief return WTA transitions to be generalized
/// to augmented transitions targeted by this key or an instance.
/// @param s a stack to be filled with WTA transitions to be augmented.
/// @param env parsing environment, containing a wta
/// and pool of multi-bar transitions. can be modified.
virtual
void
transitions
(
std
::
stack
<
const
Transition
*>&
s
,
ParsingEnv
&
env
)
const
;
/// @brief for use as key in a unordered_multimap.
virtual
bool
operator
==
(
const
KeySV
&
p
)
const
;
virtual
bool
operator
!=
(
const
KeySV
&
p
)
const
;
/// @brief return wether this Key is an instance of p.
/// = equality in this case because KeyS are always complete.
virtual
bool
instance
(
const
KeySV
&
p
)
const
;
/// @brief all attributes of the key are valued
virtual
bool
complete
()
const
;
/// @return a pointer to a newly allocated fail run, with
/// - transition with dummy symbol, empty body, weight one in the
/// domain of the base wta in the passed environment.
/// - fail symbol
/// - weight one (in the domain of the base wta).
/// This returned run will answer succesfully to Run.fail().
// RunTerm* failRun(const ParsingEnv& env) const;
/// @brief accessor
/// sequence of IOI (rationals) associated to this state.
virtual
const
ValueList
&
value
()
const
{
return
_list
;
}
/// @brief printer
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
o
,
const
KeySV
&
k
);
protected:
/// sequence of IOI (rationals) associated to this state.
...
...
@@ -225,13 +135,50 @@ protected:
/// convenience to avoid recomputation. ignored for key equality.
mtu_t
_start
;
/// is fi
e
rst child
/// is first child
/// @todo RM (debug)
bool
_fs
;
// @brief constructor for internal use
// KeySV(state_t s, const ValueList& seg);
/// @param k target key for the run. can be partial.
/// @param r an inner run to be completed with the key initialized.
/// @param env input environment.
virtual
void
init
(
const
KeySV
&
k
,
RunInner
<
KeySV
>&
r
,
const
ParsingEnv
&
env
);
/// @param k parent of this key
/// @param t base wta transition to be augmented with the constructed key.
/// @param env parsing environment, contain an input segment,
/// and interval tree and heap.
void
init_firstchild
(
const
KeySV
&
k
,
const
Transition
&
t
,
const
ParsingEnv
&
env
);
/// @param parent parent of this key (target of the run it belongs to).
/// @param prev previous sibling of this key (in the run it belongs to).
/// @param t base wta transition to be augmented with the constructed key.
/// @param i index of the next sibling in run (and transition)
/// @param env parsing environment, contain an input segment,
/// and interval tree and heap.
void
init_nextsibling
(
const
KeySV
&
parent
,
const
KeySV
&
prev
,
const
Transition
&
t
,
size_t
i
,
const
ParsingEnv
&
env
);
/// @param head key to be instanciated (i.e. this key will be an instance of k).
/// @param last complete key, last child of this key.
/// @param t base wta transition to be augmented, with the constructed target key.
/// @param env parsing environment, contain an input segment,
/// and interval tree and heap.
void
init_instanciate
(
const
KeySV
&
head
,
const
KeySV
&
last
,
const
Transition
&
t
,
const
ParsingEnv
&
env
);
/// @brief accessor
virtual
size_t
size
()
const
;
...
...
@@ -239,90 +186,33 @@ protected:
/// in order to make a transition to this Key state.
/// @todo RM : replaced by size()
virtual
size_t
points
()
const
;
/// @brief weight for the case of a and tr inner.
/// @todo case zero redundant with filterInnerLabel ?
virtual
Weight
innerWeight
(
label_t
a
,
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
/// @brief weight for the case of a and tr terminal.
/// @todo case zero redundant with filterTerminalLabel ?
virtual
Weight
terminalWeight
(
label_t
a
,
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
/// @param s target state of the build transition
/// @param env parsing environment, containing a pool
/// of multi-bar transitions. can be modified.
/// @return reference of the transition added.
virtual
Transition
&
addNullaryBarTransition
(
state_t
s
,
ParsingEnv
&
env
)
const
;
/// @param s target state of the build transition
/// @param env parsing environment, containing a pool
/// of multi-bar transitions. can be modified.
/// @return reference of the transition added.
virtual
Transition
&
addBinaryBarTransition
(
state_t
s
,
ParsingEnv
&
env
)
const
;
virtual
void
transitionsWTA
(
std
::
stack
<
const
Transition
*>&
st
,
ParsingEnv
&
env
)
const
;
virtual
void
transitionsBar
(
std
::
stack
<
const
Transition
*>&
st
,
ParsingEnv
&
env
)
const
;
/// @brief compatibility of this key with the given label symbol.
/// @param a a label. must be inner.
/// @param env parsing environment.
/// @return whether the given symbol a can label
/// a transition targeted by this key.
/// @todo redundant with innerWeight = zero ?
virtual
bool
filterInnerLabel
(
const
label_t
&
a
,
const
ParsingEnv
&
env
)
const
;
/// @brief compatibility of this key with the given transition.
/// @param tr a wta transition. must be inner.
/// @param env parsing environment.
/// @return whether the given transition tr can be generalized
/// to a transition targeted by this key.
virtual
bool
filterInnerTransition
(
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
// @brief number of input point to read for transition from the given
// label symbol to this key.
// @param a a label. must be terminal.
// @param env parsing environment.
// @return -1 if the given symbol a cannot label a transition targeted by
// this key, or, otherwise, the number of points of the interval
// to read (parse) when making the transition from symbol a to this Key.
//virtual long pointsTerminalLabel(const label_t& a,
// const ParsingEnv& env) const;
/// @brief compatibility of this key with the given label symbol.
/// @param a a label. must be terminal.
/// @param env parsing environment.
/// @return whether the given symbol a can label
/// a transition targeting to this key.
/// @todo redundant with terminalWeight = zero ?
virtual
bool
filterTerminalLabel
(
const
label_t
&
a
,
const
ParsingEnv
&
env
)
const
;
/// @brief compatibility of this key with the given transition.
/// @param tr a wta transition. must be terminal.
/// @param env parsing environment.
/// @return whether the given transition tr can be generalized
/// to a transition targeted by this key.
virtual
bool
filterTerminalTransition
(
const
Transition
&
tr
,
const
ParsingEnv
&
env
)
const
;
/// add to the given stack some terminal runs built from the given transition.
/// @param t transition to build terminal runs. must be terminal and complete.
/// @param st a stack to be filled with pairs containing terminal runs.
virtual
void
RunsTerminal
(
const
Transition
&
t
,
std
::
stack
<
std
::
pair
<
const
KeySV
*
,
RunTerm
*>>&
st
,
const
ParsingEnv
&
env
)
const
;
/// add to the given stack some inner runs built from the given transition.
/// @param t transition to build inner runs. must be inner and complete.
/// @param si a stack to be filled with inner runs.
/// @warning the runs constructed are added to the given stack.
/// They can be partial or complete.
/// They must be deallocate elsewhere.
virtual
void
RunsInner
(
const
Transition
&
t
,
std
::
stack
<
RunInner
<
KeySV
>*>&
si
,
const
ParsingEnv
&
env
)
const
;
private:
/// this key can be used as body of terminal transition with given label.
/// @param label must be terminal (arity = 0) and insider the bar symbol.
bool
compatible
(
label_t
label
)
const
;
};
...
...
src/parsing/Ranked.hpp
View file @
858113d1
...
...
@@ -19,6 +19,7 @@
#include "Transition.hpp"
#include "ParsingEnv.hpp"
namespace
parsing
{
...
...
src/segment/ValueList.hpp
View file @
858113d1
...
...
@@ -78,6 +78,7 @@ public:
size_t
size
()
const
{
return
(
_main
.
size
()
+
((
_continuation
>
0
)
?
1
:
0
));
}
/// total duration that the list can contain, including continuation
inline
mtu_t
length
()
const
{
return
_length
;
}
/// value of the continuation
...
...
src/targets/equiv/equiv2.cpp
View file @
858113d1
...
...
@@ -51,10 +51,10 @@
// #include "KeySIR.hpp"
#include "KeySV.hpp"
#include "Runey.hpp"
#include "RunInner.hpp"
#include "RunTerm.hpp"
#include "RunInner.hpp"
#include "RunCompare.hpp"
#include "Recordey.hpp"
//
#include "Recordey.hpp"
#include "RecordOne.hpp"
#include "RecordQueue.hpp"
#include "TableA.hpp"
...
...
src/targets/quant/squant2.cpp
View file @
858113d1
...
...
@@ -82,7 +82,7 @@
#include "Voicing.hpp"
#include "VoicingMono.hpp"
// switch options for
WCFG
weight
//
weight domains.
switch options for
SWTA
weight
#include "Weight.hpp"
#include "WeightDom.hpp"
#include "FloatWeight.hpp"
...
...
@@ -107,8 +107,10 @@
#include "KeySIO.hpp"
#include "Runey.hpp"
#include "RunInner.hpp"
//#include "RunRanked.hpp"
#include "RunTerm.hpp"
#include "RunCompare.hpp"
//#include "Recordey.hpp"
#include "RecordOne.hpp"
#include "RecordQueue.hpp"
#include "TableA.hpp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment