first upload

This commit is contained in:
Marvin Sanchez 2016-08-19 08:53:01 +08:00
parent 7773208fb2
commit 5765570617
21 changed files with 6101 additions and 0 deletions

BIN
data/.DS_Store vendored Normal file

Binary file not shown.

31
data/canons.yaml Normal file
View File

@ -0,0 +1,31 @@
legal ethics:
CHAPTER I. THE LAWYER AND SOCIETY:
CANON 1 - A LAWYER SHALL UPHOLD THE CONSTITUTION, OBEY THE LAWS OF THE LAND AND PROMOTE RESPECT FOR LAW OF AND LEGAL PROCESSES.
CANON 2 - A LAWYER SHALL MAKE HIS LEGAL SERVICES AVAILABLE IN AN EFFICIENT AND CONVENIENT MANNER COMPATIBLE WITH THE INDEPENDENCE, INTEGRITY AND EFFECTIVENESS OF THE PROFESSION.
CANON 3 - A LAWYER IN MAKING KNOWN HIS LEGAL SERVICES SHALL USE ONLY TRUE, HONEST, FAIR, DIGNIFIED AND OBJECTIVE INFORMATION OR STATEMENT OF FACTS.
CANON 4 - A LAWYER SHALL PARTICIPATE IN THE DEVELOPMENT OF THE LEGAL SYSTEM BY INITIATING OR SUPPORTING EFFORTS IN LAW REFORM AND IN THE IMPROVEMENT OF THE ADMINISTRATION OF JUSTICE.
CANON 5 - A LAWYER SHALL KEEP ABREAST OF LEGAL DEVELOPMENTS, PARTICIPATE IN CONTINUING LEGAL EDUCATION PROGRAMS, SUPPORT EFFORTS TO ACHIEVE HIGH STANDARDS IN LAW SCHOOLS AS WELL AS IN THE PRACTICAL TRAINING OF LAW STUDENTS AND ASSIST IN DISSEMINATING THE LAW AND JURISPRUDENCE.
CANON 6 - THESE CANONS SHALL APPLY TO LAWYERS IN GOVERNMENT SERVICES IN THE DISCHARGE OF THEIR TASKS.
CHAPTER II. THE LAWYER AND THE LEGAL PROFESSION:
CANON 7 - A LAWYER SHALL AT ALL TIMES UPHOLD THE INTEGRITY AND DIGNITY OF THE LEGAL PROFESSION AND SUPPORT THE ACTIVITIES OF THE INTEGRATED BAR.
CANON 8 - A LAWYER SHALL CONDUCT HIMSELF WITH COURTESY, FAIRNESS AND CANDOR TOWARDS HIS PROFESSIONAL COLLEAGUES, AND SHALL AVOID HARASSING TACTICS AGAINST OPPOSING COUNSEL.
CANON 9 - A LAWYER SHALL NOT, DIRECTLY OR INDIRECTLY, ASSIST IN THE UNAUTHORIZED PRACTICE OF LAW.
CHAPTER III. THE LAWYER AND THE COURTS:
CANON 10 - A LAWYER OWES CANDOR, FAIRNESS AND GOOD FAITH TO THE COURT.
CANON 11 - A LAWYER SHALL OBSERVE AND MAINTAIN THE RESPECT DUE TO THE COURTS AND TO JUDICIAL OFFICERS AND SHOULD INSIST ON SIMILAR CONDUCT BY OTHERS.
CANON 12 - A LAWYER SHALL EXERT EVERY EFFORT AND CONSIDER IT HIS DUTY TO ASSIST IN THE SPEEDY AND EFFICIENT ADMINISTRATION OF JUSTICE.
CANON 13 - A LAWYER SHALL RELY UPON THE MERITS OF HIS CAUSE AND REFRAIN FROM ANY IMPROPRIETY WHICH TENDS TO INFLUENCE, OR GIVES THE APPEARANCE OF INFLUENCING THE COURT.
CHAPTER IV. THE LAWYER AND THE CLIENT:
CANON 14 - A LAWYER SHALL NOT REFUSE HIS SERVICES TO THE NEEDY.
CANON 15 - A LAWYER SHALL OBSERVE CANDOR, FAIRNESS AND LOYALTY IN ALL HIS DEALINGS AND TRANSACTIONS WITH HIS CLIENTS.
CANON 16 - A LAWYER SHALL HOLD IN TRUST ALL MONEYS AND PROPERTIES OF HIS CLIENT THAT MAY COME INTO HIS PROFESSION.
CANON 17 - A LAWYER OWES FIDELITY TO THE CAUSE OF HIS CLIENT AND HE SHALL BE MINDFUL OF THE TRUST AND CONFIDENCE REPOSED IN HIM.
CANON 18 - A LAWYER SHALL SERVE HIS CLIENT WITH COMPETENCE AND DILIGENCE.
CANON 19 - A LAWYER SHALL REPRESENT HIS CLIENT WITH ZEAL WITHIN THE BOUNDS OF THE LAW.
CANON 20 - A LAWYER SHALL CHARGE ONLY FAIR AND REASONABLE FEES.
CANON 21 - A LAWYER SHALL PRESERVE THE CONFIDENCE AND SECRETS OF HIS CLIENT EVEN AFTER THE ATTORNEY-CLIENT RELATION IS TERMINATED.
CANON 22 - A LAWYER SHALL WITHDRAW HIS SERVICES ONLY FOR GOOD CAUSE AND UPON NOTICE APPROPRIATE IN THE CIRCUMSTANCES.

819
data/civpro.json Normal file
View File

@ -0,0 +1,819 @@
{
"_class": "style2",
"edges": [
{
"n1": "depositions",
"n2": "written_inter"
},
{
"n1": "modes_of_disc",
"n2": "vs_modes_of_disc"
},
{
"n1": "before_answer",
"n2": "motion_dismiss"
},
{
"n1": "join_parties1",
"n2": "join_parties2"
},
{
"n1": "summons",
"n2": "over_parties"
}
],
"nodes": [
{
"nodes": [
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "style2"
},
{
"text": "_"
}
],
"text": "_css"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
},
{
"_class": "style2",
"nodes": [
{
"text": "of the courts"
},
{
"name": "over_parties",
"text": "over the parties"
},
{
"text": "over the subject matter"
},
{
"text": "over the issues"
},
{
"text": "over the res"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "jurisdiction"
},
{
"name": "summons",
"nodes": [
{
"_class": "style2",
"nodes": [
{
"text": "personal service"
},
{
"text": "substituted service"
},
{
"nodes": [
{
"text": "identity or whereabouts unknown"
},
{
"text": "residents temporarily outside"
},
{
"text": "_"
}
],
"text": "constructive service (publication)"
},
{
"text": "extra-territorial service"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "modes"
},
{
"nodes": [
{
"text": "remedies"
},
{
"text": "requisites"
},
{
"text": "_"
}
],
"text": "default"
},
{
"text": "answer with 15,30,60 days"
},
{
"text": "_"
}
],
"text": "summons"
},
{
"_class": "style2",
"childrenDirection": "down",
"direction": "left",
"name": "modes_of_disc",
"nodes": [
{
"_class": "style2",
"childrenDirection": "down",
"name": "depositions",
"nodes": [
{
"nodes": [
{
"text": "in prison"
},
{
"text": "after obtained jurisdiction, before answer"
},
{
"text": "_"
}
],
"text": "with leave"
},
{
"text": "without leave"
},
{
"text": "protection order, for good cause [rule 16]"
},
{
"nodes": [
{
"text": "conducted in bad faith or in manner\nunreasonably to annoy, embarrass, oppress"
},
{
"text": "_"
}
],
"text": "motion to terminate or limit [rule 18]"
},
{
"nodes": [
{
"text": "present"
},
{
"text": "represented"
},
{
"text": "had notice"
},
{
"text": "_"
}
],
"text": "use against"
},
{
"nodes": [
{
"text": "by any party to impeach, contradict"
},
{
"text": "deposition of officer, director or managing agent\nby adverse party for any purpose"
},
{
"text": "deposition of witness for any purpose"
},
{
"text": "_"
}
],
"text": "used by"
},
{
"text": "pending action"
},
{
"nodes": [
{
"text": "verified petition"
},
{
"text": "_"
}
],
"text": "before action or pending appeal"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "depositions"
},
{
"childrenDirection": "down",
"name": "written_inter",
"nodes": [
{
"text": "elicit facts from any adverse party"
},
{
"text": "party not served may not be\ncompelled to give testimony"
},
{
"text": "with leave before answer is served\nbecause issues are not yet joined"
},
{
"text": "versus"
},
{
"text": "any time after issues have been joined"
},
{
"nodes": [
{
"text": "genuiness of any material and relevant document"
},
{
"text": "truth of any material and relevant matter"
},
{
"text": "a mater of fact not related to\nany document for admission or denial"
},
{
"text": "_"
}
],
"text": "scope"
},
{
"text": "_"
}
],
"text": "written interrogatories"
},
{
"nodes": [
{
"text": "MUST be SERVED upon party requested, not his counsel"
},
{
"text": "relevant and material matters of fact\nnot matters of law, conclusion, opinions"
},
{
"nodes": [
{
"text": "except for good cause and\nprevent failure of justice"
},
{
"text": "_"
}
],
"text": "failure to serve a request-\ncannot be permitted to present evidence\non such fact"
},
{
"text": "_"
}
],
"text": "request for admission"
},
{
"nodes": [
{
"nodes": [
{
"text": "limited to parties"
},
{
"text": "may be before or during trial"
},
{
"text": "on motion"
},
{
"text": "_"
}
],
"text": "vs subpoena"
},
{
"text": "_"
}
],
"text": "production and inspection\nof documents"
},
{
"nodes": [
{
"text": "in a pending action"
},
{
"text": "mental or physical condition is in controversy"
},
{
"text": "waiver of privilege [section 4]"
},
{
"text": "_"
}
],
"text": "physical and mental examination [Rule 28]"
},
{
"childrenDirection": "down",
"nodes": [
{
"text": "compel"
},
{
"text": "party or counsel, or both pay"
},
{
"text": "contempt"
},
{
"nodes": [
{
"text": "facts or documents deemed established"
},
{
"text": "refuse claims or defense"
},
{
"text": "refuse introduction of evidence"
},
{
"text": "striking out"
},
{
"text": "staying the proceedings"
},
{
"text": "dismissing the action or part thereof"
},
{
"text": "rendering DEFAULT JUDGMENT"
},
{
"text": "arrest"
},
{
"text": "payment of reasonable expenses"
},
{
"text": "_"
}
],
"text": "other consequences"
},
{
"text": "_"
}
],
"text": "refusal to comply [Rule 29]"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "modes of discovery"
},
{
"nodes": [
{
"nodes": [
{
"text": "enforcemenf ot right, redress of wrong"
},
{
"text": "prosecution for acts or omissions punishable"
},
{
"text": "specpro; establish status, right, fact"
},
{
"text": "_"
}
],
"text": "causes of actions"
},
{
"childrenDirection": "down",
"nodes": [
{
"text": "stands to be benefited,\nentitled to avails of the suit"
},
{
"text": "intervention"
},
{
"text": "compulsory joinder of indispensable\nwithout whom no final determination can be had"
},
{
"text": "necessary parties\nif complete relief is to be accorded"
},
{
"nodes": [
{
"text": "common controversy"
},
{
"text": "numerous, impracticable to join"
},
{
"text": "sufficiently numerous and representative as to protect"
},
{
"text": "_"
}
],
"text": "class suit"
},
{
"nodes": [
{
"text": "actions that survive"
},
{
"childrenDirection": "down",
"nodes": [
{
"text": "heirs may substitute"
},
{
"text": "appointment of administrator"
},
{
"text": "_"
}
],
"text": "duty of counsel ~ inform court with 30 days\nname and address of representative"
},
{
"text": "_"
}
],
"text": "death"
},
{
"_class": "style2",
"name": "join_parties1",
"nodes": [
{
"_class": "style2",
"childrenDirection": "down",
"nodes": [
{
"text": "right to relief"
},
{
"text": "in respect or arising out of same transaction (series)"
},
{
"text": "common question of law or fact to all\nplaintiffs or defendants"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "requisites"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "joinder of parties"
},
{
"text": "_"
}
],
"text": "parties"
},
{
"_class": "style2",
"nodes": [
{
"text": "splitting"
},
{
"_class": "style2",
"nodes": [
{
"name": "join_parties2",
"text": "joinder of parties"
},
{
"text": "no special civil actions"
},
{
"text": "totality rule (aggregate amount)"
},
{
"text": "venue, jurisdiction\nRTC, if venue lies therein"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "requisites"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "joinder of actions"
},
{
"text": "venue of actions"
},
{
"text": "_"
}
],
"text": "actions"
},
{
"_class": "style2",
"direction": "left",
"nodes": [
{
"text": "difference with\ncriminal proceedings"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "demurrer to evidence"
},
{
"nodes": [
{
"nodes": [
{
"text": "execution pending appeal"
},
{
"text": "_"
}
],
"text": "execution"
},
{
"text": "summary judgments"
},
{
"text": "judgment on the pleadings"
},
{
"text": "_"
}
],
"text": "judgments"
},
{
"_class": "style2",
"nodes": [
{
"childrenDirection": "down",
"nodes": [
{
"nodes": [
{
"nodes": [
{
"text": "prudence could not have\nguared against"
},
{
"text": "_"
}
],
"text": "FAME"
},
{
"nodes": [
{
"text": "diligence;\nchanges the result"
},
{
"text": "_"
}
],
"text": "newly discovered evidence"
},
{
"text": "_"
}
],
"text": "new trial"
},
{
"nodes": [
{
"text": "excessive"
},
{
"text": "contrary to law"
},
{
"text": "not supporte by\nevidence"
},
{
"text": "_"
}
],
"text": "MR"
},
{
"text": "_"
}
],
"text": "motion for new trial\nmotion for reconsideration"
},
{
"text": "appeal"
},
{
"nodes": [
{
"text": "FAME"
},
{
"text": "_"
}
],
"text": "relief from judgment"
},
{
"nodes": [
{
"text": "extrinsic fraud"
},
{
"text": "lack of jurisdiction\n(including lack of due process)"
},
{
"text": "_"
}
],
"text": "annulment of judgment"
},
{
"text": "collateral attack"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "post-judgment\nremedies"
},
{
"_class": "style2",
"name": "motion_dismiss",
"nodes": [
{
"text": "lack of jurisdiction"
},
{
"text": "litis pendencia"
},
{
"text": "res judicata"
},
{
"text": "prescription"
},
{
"border": "2",
"borderColor": "FF0000",
"edge": "3",
"margin": "4",
"text": "_"
}
],
"text": "motion to dismiss"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "matter of right - before responsive"
},
{
"text": "with leave - after"
},
{
"text": "_"
}
],
"text": "amendments"
},
{
"text": "supplemental pleadings"
},
{
"nodes": [
{
"name": "vs_modes_of_disc",
"text": "vs modes of discovery"
},
{
"text": "_"
}
],
"text": "bill of particulars"
},
{
"text": "_"
}
],
"text": "pleadings"
},
{
"direction": "left",
"nodes": [
{
"text": "elections"
},
{
"text": "land regsitration"
},
{
"text": "cadastral"
},
{
"text": "naturalization"
},
{
"text": "insolvency"
},
{
"text": "_"
}
],
"text": "no applicable"
},
{
"direction": "left",
"name": "before_answer",
"text": "before the answer"
}
],
"text": "Civil\nProcedure"
}

278
data/civpro.yaml Normal file
View File

@ -0,0 +1,278 @@
Civil\nProcedure:
_css
style2
border:2
margin:4
borderColor:FF0000
edge:3
_class:style2
_style:
margin:4
jurisdiction:
_class:style2
of the courts
over the parties:
name:over_parties
over the subject matter
over the issues
over the res
summons:
name:summons
modes:
_class:style2
personal service
substituted service
constructive service (publication):
identity or whereabouts unknown
residents temporarily outside
extra-territorial service
default:
remedies
requisites
answer with 15,30,60 days
modes of discovery:
name:modes_of_disc
direction:left
_class:style2
childrenDirection:down
depositions:
name:depositions
_class:style2
childrenDirection:down
with leave:
in prison
after obtained jurisdiction, before answer
without leave
protection order, for good cause [rule 16]
motion to terminate or limit [rule 18]:
conducted in bad faith or in manner\nunreasonably to annoy, embarrass, oppress
use against:
present
represented
had notice
used by:
by any party to impeach, contradict
deposition of officer, director or managing agent\nby adverse party for any purpose
deposition of witness for any purpose
pending action
before action or pending appeal:
verified petition
written interrogatories:
name:written_inter
childrenDirection:down
elicit facts from any adverse party
party not served may not be\ncompelled to give testimony
with leave before answer is served\nbecause issues are not yet joined
versus
any time after issues have been joined
scope:
genuiness of any material and relevant document
truth of any material and relevant matter
a mater of fact not related to\nany document for admission or denial
request for admission:
MUST be SERVED upon party requested, not his counsel
relevant and material matters of fact\nnot matters of law, conclusion, opinions
failure to serve a request-\ncannot be permitted to present evidence\non such fact:
except for good cause and\nprevent failure of justice
production and inspection\nof documents:
vs subpoena:
limited to parties
may be before or during trial
on motion
physical and mental examination [Rule 28]:
in a pending action
mental or physical condition is in controversy
waiver of privilege [section 4]
refusal to comply [Rule 29]:
childrenDirection:down
compel
party or counsel, or both pay
contempt
other consequences:
facts or documents deemed established
refuse claims or defense
refuse introduction of evidence
striking out
staying the proceedings
dismissing the action or part thereof
rendering DEFAULT JUDGMENT
arrest
payment of reasonable expenses
actions:
causes of actions:
enforcemenf ot right, redress of wrong
prosecution for acts or omissions punishable
specpro; establish status, right, fact
parties:
childrenDirection:down
stands to be benefited,\nentitled to avails of the suit
intervention
compulsory joinder of indispensable\nwithout whom no final determination can be had
necessary parties\nif complete relief is to be accorded
class suit:
common controversy
numerous, impracticable to join
sufficiently numerous and representative as to protect
death:
actions that survive
duty of counsel ~ inform court with 30 days\nname and address of representative:
childrenDirection:down
heirs may substitute
appointment of administrator
joinder of parties:
name:join_parties1
_class:style2
requisites:
_class:style2
childrenDirection:down
right to relief
in respect or arising out of same transaction (series)
common question of law or fact to all\nplaintiffs or defendants
joinder of actions:
_class:style2
splitting
requisites:
_class:style2
joinder of parties:
name:join_parties2
no special civil actions
totality rule (aggregate amount)
venue, jurisdiction\nRTC, if venue lies therein
venue of actions
demurrer to evidence:
direction:left
_class:style2
difference with\ncriminal proceedings
judgments:
execution:
execution pending appeal
summary judgments
judgment on the pleadings
post-judgment\nremedies:
_class:style2
motion for new trial\nmotion for reconsideration:
childrenDirection:down
new trial:
FAME:
prudence could not have\nguared against
newly discovered evidence:
diligence;\nchanges the result
MR:
excessive
contrary to law
not supporte by\nevidence
appeal
relief from judgment:
FAME
annulment of judgment:
extrinsic fraud
lack of jurisdiction\n(including lack of due process)
collateral attack
motion to dismiss:
name:motion_dismiss
_class:style2
lack of jurisdiction
litis pendencia
res judicata
prescription
pleadings:
direction:left
amendments:
matter of right - before responsive
with leave - after
supplemental pleadings
bill of particulars:
vs modes of discovery:
name:vs_modes_of_disc
no applicable:
direction:left
elections
land regsitration
cadastral
naturalization
insolvency
before the answer:
name:before_answer
direction:left
edges:
depositions, written_inter
modes_of_disc, vs_modes_of_disc
before_answer, motion_dismiss
join_parties1, join_parties2
summons, over_parties

575
data/crimpro.json Normal file
View File

@ -0,0 +1,575 @@
{
"_class": "style2",
"nodes": [
{
"childrenDirection": "down",
"nodes": [
{
"nodes": [
{
"text": "not constitute offense"
},
{
"text": "no juris. offense"
},
{
"text": "no juris. person"
},
{
"text": "office filed no authority"
},
{
"text": "not conform to prescribed form"
},
{
"text": "more than one offense charged"
},
{
"text": "crim liability extinguished"
},
{
"text": "contains averments constituting legal excuse"
},
{
"text": "double jeopardy"
}
],
"text": "grounds"
},
{
"nodes": [
{
"text": "facts charged not constitute an offense"
},
{
"text": "no jurisdiction over the offense"
},
{
"text": "action or liability extinguished"
},
{
"text": "double jeopardy"
}
],
"text": "not waived"
}
],
"text": "motion to quash"
},
{
"childrenDirection": "down",
"nodes": [
{
"nodes": [
{
"text": "offenses not exceeding 6\nyears imprisonment"
},
{
"text": "not more than P4000 fine"
},
{
"text": "violation of city, municipal ordinances"
},
{
"text": "damage to property through criminal negligence"
},
{
"text": "BP22"
},
{
"nodes": [
{
"text": "traffic laws"
},
{
"text": "not exceeding 6 months or not exceeding P1000"
},
{
"text": "damage to property where fine not exceeding P10000"
}
],
"text": "summary procure"
},
{
"text": "..qualified by cases falling under\nRTC and the Sandiganbayan"
},
{
"nodes": [
{
"text": "less than 4 years, 2 months, 1 day"
}
],
"text": "barangay conciliation"
}
],
"text": "MTC"
},
{
"nodes": [
{
"text": "exclusive original over all criminal cases\nexcept in MTC and Sandiganbayan\nmore than 6 years"
},
{
"text": "appellate jurisdiction over MTC"
},
{
"text": "under specific laws"
},
{
"text": "written defamation"
},
{
"text": "comprehensive dangerous drug act"
},
{
"text": "violation of intellectual property rights"
}
],
"text": "RTC"
},
{
"_class": "style2",
"nodes": [
{
"nodes": [
{
"text": "RA 3019"
},
{
"text": "RA 1379"
},
{
"text": "salary grade 27\nenumerated offiercs"
}
],
"text": "exclusive and original"
},
{
"text": "offenses and felonies\nin relation to office"
},
{
"text": "civil and criminal cases\nEO 1,2,14,14-a"
}
],
"text": "sandiganbayan"
}
],
"text": "jurisdiction"
},
{
"childrenDirection": "down",
"nodes": [
{
"text": "at least 4 years, 2 months, 1 day"
},
{
"nodes": [
{
"text": "manila and chartered cities\n.. file with office of prosecutor"
}
],
"text": "if not required\n1. file complaint MTC, MTCC\n2. or Office of prosecutor"
}
],
"text": "preliminary investigation"
},
{
"_class": "style2",
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "presumption of innonce"
},
{
"text": "excessive bail"
}
],
"text": "Sec 13. Article III Consti"
},
{
"text": "guarantee appearance"
},
{
"nodes": [
{
"text": "MTC"
},
{
"nodes": [
{
"text": "not death, reclusion perpetua\\life imprisonment"
}
],
"text": "RTC before conviction"
}
],
"text": "matter of right"
},
{
"nodes": [
{
"text": "before conviction in RTC and"
},
{
"text": "death, reclusion, life and"
},
{
"text": "evidence of guilt is strong"
}
],
"text": "matter of discretion"
},
{
"nodes": [
{
"text": "RTC, d,r,l, guilt is strong, or after conviction"
},
{
"nodes": [
{
"text": "recidivist, quasi-recidivist,\nhabitual delinquent, reiteration"
},
{
"text": "escaped, violated bail conditions"
},
{
"text": "committed offense while on probation,\nparole or conditional pardon"
},
{
"text": "indication of flight"
},
{
"text": "undue risk"
}
],
"text": "RTC, after conviction, exceeding 6 years and"
}
],
"text": "matter of denial"
}
],
"text": "bail"
},
{
"direction": "left",
"nodes": [
{
"text": "deemed instituted\nunless waived, reserved,\ninstituted prior"
},
{
"text": "independent civil actions"
},
{
"text": "new node"
}
],
"text": "civil action"
},
{
"childrenDirection": "down",
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "authorization in writing"
},
{
"text": "from Chief of Prosecution Office\nor Regioanl State Prosecutor"
},
{
"text": "approved by the court"
}
],
"text": "private prosectutor\neven without public..\n1. heavy workload\n2. lack of public prosec"
},
{
"childrenDirection": "down",
"nodes": [
{
"text": "adulter and concubinage"
},
{
"text": "seduction, abduction, acts of lasciviousness"
},
{
"text": "RA 7610"
},
{
"text": "defamation consisting of imputation\nof offense of adultery, concubinage.."
}
],
"text": "private crimes"
},
{
"text": "direction and control"
}
],
"text": "prosecution"
},
{
"childrenDirection": "down",
"direction": "left",
"nodes": [
{
"text": "sworn written statement"
},
{
"text": "charging with an offense"
},
{
"nodes": [
{
"text": "1. offended party; or"
},
{
"text": "2. peace officer; or"
},
{
"text": "3. public officer charged with\nenforcement of law violated"
}
],
"text": "subscribed by"
}
],
"text": "complaint"
},
{
"direction": "left",
"nodes": [
{
"text": "written statement"
},
{
"text": "subscribed by prosecutor"
}
],
"text": "information"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"nodes": [
{
"text": "no leave"
},
{
"nodes": [
{
"text": "downgrades"
},
{
"text": "excludes one of the accused"
}
],
"text": "leave of court (even before plea) if"
},
{
"text": "motion by prosecutor, notice to offended"
}
],
"text": "before plea"
},
{
"nodes": [
{
"nodes": [
{
"text": "leave of court"
},
{
"text": "must not prejudice rights"
}
],
"text": "formal"
},
{
"nodes": [
{
"text": "not allowed"
}
],
"text": "substantial"
}
],
"text": "after plea"
}
],
"text": "amendment"
},
{
"nodes": [
{
"text": "mistake in the charging the proper offense"
},
{
"text": "must not put accused in double jeopardy"
}
],
"text": "substitution"
}
],
"text": "substitution"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "motion for leave (with 5 days from rest)"
},
{
"nodes": [
{
"text": "if demurrer granted ~ acquittal"
}
],
"text": "if granted, file the demurrer within 10"
},
{
"text": "if denied, adduce evidence"
}
],
"text": "with leave"
},
{
"nodes": [
{
"text": "if demurrer granted ~ acquittal"
},
{
"text": "if denied, waives right to adduce evidence"
}
],
"text": "without leave"
}
],
"text": "demurrer to evidence"
},
{
"nodes": [
{
"nodes": [
{
"nodes": [
{
"text": "convicted with the offense proved"
}
],
"text": "offense proved is different from charged"
},
{
"text": "offense charged is necessarily included in offsense proved"
},
{
"nodes": [
{
"text": "essential elements or ingredients"
}
],
"text": "or necessisarily includes offense proved"
}
],
"text": "variance"
},
{
"nodes": [
{
"text": "without just cause"
},
{
"nodes": [
{
"text": "surrender"
},
{
"text": "motion for leave to avail of remedies"
}
],
"text": "loses his remedies unless"
}
],
"text": "if accused fails to appear in promulgation"
},
{
"nodes": [
{
"text": "errors of law"
},
{
"text": "irregularities prejudicial to substantial rights"
},
{
"nodes": [
{
"text": "discovered after the trial"
},
{
"text": "diligence"
},
{
"text": "probably change the judgment"
}
],
"text": "new and material evidence"
},
{
"text": "effect ~ set aside, taken anew, allow new evidence"
}
],
"text": "new trial (grounds)"
},
{
"nodes": [
{
"text": "errors of law which requires no further proceedings"
},
{
"text": "errors of fact which requires no further proceedings"
},
{
"text": "effects ~ set aside, new judgment rendered"
}
],
"text": "reconsideration"
},
{
"nodes": [
{
"text": "notice of appeal"
},
{
"text": "within 15 days"
}
],
"text": "appeal"
},
{
"nodes": [
{
"text": "about to abscond"
},
{
"text": "crime founded upon a claim of property embezzled"
},
{
"text": "concealed, removed, disposed, about to"
},
{
"text": "accused resides outside"
}
],
"text": "provisional remedy (attachment)"
}
],
"text": "judgment"
}
],
"text": "Criminal\nProcedure"
}

216
data/crimpro.yaml Normal file
View File

@ -0,0 +1,216 @@
Criminal\nProcedure:
_class:style2
motion to quash:
childrenDirection:down
grounds:
not constitute offense
no juris. offense
no juris. person
office filed no authority
not conform to prescribed form
more than one offense charged
crim liability extinguished
contains averments constituting legal excuse
double jeopardy
not waived:
facts charged not constitute an offense
no jurisdiction over the offense
action or liability extinguished
double jeopardy
jurisdiction:
childrenDirection:down
MTC:
offenses not exceeding 6\nyears imprisonment
not more than P4000 fine
violation of city, municipal ordinances
damage to property through criminal negligence
BP22
summary procure:
traffic laws
not exceeding 6 months or not exceeding P1000
damage to property where fine not exceeding P10000
..qualified by cases falling under\nRTC and the Sandiganbayan
barangay conciliation:
less than 4 years, 2 months, 1 day
RTC:
exclusive original over all criminal cases\nexcept in MTC and Sandiganbayan\nmore than 6 years
appellate jurisdiction over MTC
under specific laws
written defamation
comprehensive dangerous drug act
violation of intellectual property rights
sandiganbayan:
_class:style2
exclusive and original:
RA 3019
RA 1379
salary grade 27\nenumerated offiercs
offenses and felonies\nin relation to office
civil and criminal cases\nEO 1,2,14,14-a
preliminary investigation:
childrenDirection:down
at least 4 years, 2 months, 1 day
if not required:\n1. file complaint MTC, MTCC\n2. or Office of prosecutor:
manila and chartered cities\n.. file with office of prosecutor
bail:
direction:left
_class:style2
Sec 13. Article III Consti
presumption of innonce
excessive bail
guarantee appearance
matter of right
MTC
RTC before conviction
not death, reclusion perpetua\life imprisonment
matter of discretion
before conviction in RTC and
death, reclusion, life and
evidence of guilt is strong
matter of denial
RTC, d,r,l, guilt is strong, or after conviction
RTC, after conviction, exceeding 6 years and:
recidivist, quasi-recidivist,\nhabitual delinquent, reiteration
escaped, violated bail conditions
committed offense while on probation,\nparole or conditional pardon
indication of flight
undue risk
civil action:
direction:left
deemed instituted\nunless waived, reserved,\ninstituted prior
independent civil actions
new node
prosecution:
direction:left
childrenDirection:down
private prosectutor\neven without public..\n1. heavy workload\n2. lack of public prosec:
authorization in writing
from Chief of Prosecution Office\nor Regioanl State Prosecutor
approved by the court
private crimes:
childrenDirection:down
adulter and concubinage
seduction, abduction, acts of lasciviousness
RA 7610
defamation consisting of imputation\nof offense of adultery, concubinage..
direction and control
complaint:
direction:left
childrenDirection:down
sworn written statement
charging with an offense
subscribed by::
1. offended party; or
2. peace officer; or
3. public officer charged with\nenforcement of law violated
information:
direction:left
written statement
subscribed by prosecutor
substitution:
direction:left
amendment
before plea
no leave
leave of court (even before plea) if:
downgrades
excludes one of the accused
motion by prosecutor, notice to offended
after plea
formal
leave of court
must not prejudice rights
substantial
not allowed
substitution:
mistake in the charging the proper offense
must not put accused in double jeopardy
demurrer to evidence:
direction:left
with leave
motion for leave (with 5 days from rest)
if granted, file the demurrer within 10
if demurrer granted ~ acquittal
if denied, adduce evidence
without leave
if demurrer granted ~ acquittal
if denied, waives right to adduce evidence
judgment:
variance:
offense proved is different from charged
convicted with the offense proved
offense charged is necessarily included in offsense proved
or necessisarily includes offense proved
essential elements or ingredients
if accused fails to appear in promulgation
without just cause
loses his remedies unless
surrender
motion for leave to avail of remedies
new trial (grounds):
errors of law
irregularities prejudicial to substantial rights
new and material evidence
discovered after the trial
diligence
probably change the judgment
effect ~ set aside, taken anew, allow new evidence
reconsideration
errors of law which requires no further proceedings
errors of fact which requires no further proceedings
effects ~ set aside, new judgment rendered
appeal
notice of appeal
within 15 days
provisional remedy (attachment):
about to abscond
crime founded upon a claim of property embezzled
concealed, removed, disposed, about to
accused resides outside

1058
data/ethics.json Normal file

File diff suppressed because it is too large Load Diff

440
data/ethics.yaml Normal file
View File

@ -0,0 +1,440 @@
legal ethics:
IBP:
failure to pay dues within 6 months ~ suspension
more than 1 year ~ remove from roll of attorneys
practice of law:
_class:style2
any activity, in or out of court
application of law, legal procedure, knowledge, training, experience;
to give notice or render any kind of service
use in any degree of legal knowledge or skill
Cayetano vs Monsod (1991)
reacquisition of citizenship:
petition of benjamin dacanay
ra 9225:
update IBP dues
professional tax
36 hours mcle
retake lawyer's oath
appearance of non-lawyers:
mtc:
litigant personally
aid of agent or friend
criminal case:
court may appoint:
resident
good repute for probity and ability
rtc:
litigant personally
assitance of lawyer
appearance students:
completed 3yr
accredited clinical legal education program
in any civil, criminal, administrative
appearance in RTC:
direct supervision and control of a lawyer
prohibited practice:
absolute:
under consti:
president, vp, cabinet and assistants
chairman of consti commissions
member of JBC
ombudsman and deputies
LGC (7160):
governors, mayors
others:
judges, court officials and employees
solicitor general
government prosecutors
civil service employees require full devotion
special laws
not absolute:
senators, members of the house (cannot appear)
members of sanggunian (not against gov't)
retire justice or judge (not against gov't)
civil service employees (permission from dept head)
duties:
4-fold:
to the society
to the court
to the profession
to his client
9-fold C2A2R2E2D:
Counsel only honesty debatable
maintain inviolate Confidence
Allegiance
Abstain:
offensive personality
advance no fact prejudicial to honor and reputation
Respect due to court and officers
never Reject the defenseless and oppressed
Employ:
means consistent with truth and honor
never mislead
not Encourage (delay man's cause for corrupt motive or interest)
Defend a person accused:
by fair and honrable means
regardless of personal opinion of guilt
chapter 1:
the lawyer and society
canon 1:
unlawful, dishonest, immoral or deceitful conduct
unlawful:
transgression of any law, evil intent not essential
dishonest:
absence of integrity
disposition to cheat, deceive or defraud
immoral:
willful, flagrant, shameless
indifference to opinion of good and respectable members
moral turpitude:
act of baseness, vileness, or depravity\nin the duties owed
contrary to usually accepted or customary rules
gross immorality:
so corrupt and false as to constitute a criminal act
or so unprincipled or disgraceful as to be reprehensible\nto a high degree
need not be scandalous nor a criminal offense
some acts:
maintenance - intermeddling of an interested party to encourage lawsuit
barratry - frequently exciting or stirring up quarrels and suits
ambulance chasing - soliciting legal business
canon 2:
not a business:
not a money-making venture
officers of the court
fiduciary relations
candor, fairness, no encroachment
canon 4:
MCLE:
ensure to keep abreast with law and jurisprudence\nmaintain ethics of the profession\nenhance standards of the practice
36 hours, every three years
application for exemption:
under oath
for good cause
non-compliance:
listed as deliquent
BM 1922:
indicate in all pleadings, number and date of issue
failure results (as amended)\nsubject the counsel to appropriate penalty and disciplinary action
chapter 2:
the lawyer and the legal profession
canon 8:
COURTEST, fairness, candor to colleagues
encroachment:
conformity of counsel
or at least notice to counsel
canon 9:
not directy or indirectly assist in the unauthorized practice of law
chapter 3:
the lawyer and the court
canon 10:
candor, fairness, GOOD FAITH to the court
canon 11:
Rule 11.04:
not attribute motives not supported by the record\nor have no materiality on the case
Almacen:
not undermine the confidence of the people\nin the honesty of members of the court
Zaldivar vs Gonzales:
criticism shall be bona fide
not spill over the walls of decency and propriety
Rule 11.05:
submit grievances to proper authority
Office of the Court Administrator
if impeachable offense, Senate and House of Representative
canon 12:
witness-lawyer:
on formal matters such as\nmailing, authenticity of instrument
on substantial matters:
essential to the ends of justice
entrust case to another counsel
chapter 4:
direction:left
the lawyer and the client
relationship:
personal
fiduciary
confidential
canon 14:
General rule-\nnot obliged to act as counsel\nexcept:
not refuse services to the needy (Bill of Rights, free access)
not decline by reason of race, sex, creed, status, opinion of guilt
appointed as counsel de oficio or amicus curiae
may decline:
for serious and sufficient reason
not capable effectively or competently
conflict of interest
mandatory legal aid service\n(BM 2012):
indigent litigant:
gross income including immediate family < double minimum wage
no real property with FMV of more than P300K
authorized by court after ex parte application and hearing
requirements:
60 hours of free legal aid for each year\nspread 5 hours each month\nexcess may be credited to succeding periond
compliance report within 10 days\nof last month of each year
secure certificate
indicate in all pleadings number and date of issue
penalties:
declaration of not in good standing
pay P4000
NIGS effective for 3 months until paid
cannot appear as counsel while NIGS
disciplined for non-compliance 3 consecutive years
incentive:
10% allowable deduction from gross income
exclusive of 60 hours minimum
canon 15:
candor, fairness, LOYALTY to client
Regala vs Sandiganbayan:
strong probability that\nrevealing the clients name\nwould implicate the client\nin very activity he sought advice
opens client to civil liability
last link doctrine\n
link to form chain of testimony leading to client
privileged communication:
legal advice is sought:
in the course of or
or with a view to professional employment
communications relative to the purpose
made in confidence
conflict of interest (tests):
conflicting duties (duty to fight for and issue and oppose)
if acceptance will require to perform act injurious to a first client\nand called upon to use acquired knowlege
prevent full discharge of undivied fidelity and loyalty\ninvite suspicion of unfaithfulness or double dealing
hilado vs david:
extent of acquired knowledge immaterial
existence of the bare relationship of attorney-client as the yardstick for testing incompatibility
prevent the dishonest practitioner from fraudulent conduct
protect the honest lawyer from unfounded suspicion of unprofessional practice
partners\nprofessional employment of firm is retainer of the members
canon 16:
hold in trust all moneys and properties:
account for collected and received
return if unused for intended purpose
deliver as they fall due or upon demand:
failure ~ presumptin of misappropriation
borrow money:
only if protected by nature of case
or by independence advice
lend money:
prohibited, as he may acquire interest in the case outcome
except:
advances for necessary expenses\nin the interest of justice
more canons:
17\nfidelity to the cause\nmind of trust and confidence
18\ncompetence and diligence
all that is required is ORdinary diligence\nor the usual prudence and circumspection
client is bound by counsels neglect and mistake, except:
results in outright DEPRIVATION of property
interset of JUSTICE as when error is technical
GROSS negligence, deprives due process:
gross negligence of counsel
meritorious defense
client himself is not negligent
PREVENTED from fully participating
LABOR cases
canon 19:
zeal within the bounds of law
fair and honest means
no filing of case to secure a leverage or advantage
rule 19.03:
shall not allow client to dictate the procedure
exclusive management of procedural aspect
client has exclusive control over substantive aspect
rule 138, section 23\nspecial authority required for lawyer to compromise\nor when ratified
canon 20:
fair and reasonable fees only
rule 20.01:
time spent
novelty
skill demanded
contingency or certainty
professional standing
rule 138 section 24:
importance of subject matter
services rendered
professional standing
written contract controls unless unconscionable or unreasonable
attorney's fees:
ordinary:
reasonable compensation for services
paid to lawyer
extraordinary:
indemnity for damages
paid to client except when there is an agreement
allowed:
agreement
just and equitable
gross and evident bad faith
action for support
award for frivoluos action
recovery of wages
..see Torts and Damages
quantum meruit:
as much as he deserves
prevents undue enrichment
Attorneys' liens (Section 37 R138):
(1) lawyer-client relationship;
(2) lawful possession of the client
(3) unsatisfied claim for attorney's fees
statement of his claim entered upon the records
before full satisfaction of judgment
written notice thereof to be delivered to his client
and to the adverse party
withdrawal:
consent of client
or with leave on justifiable ground
discharge by client:
may be denied compensation
without just cause:
express written agreement\n
must be fair and reasonable
or in no agreement, quantum meruit

246
data/ibp.json Normal file
View File

@ -0,0 +1,246 @@
{
"nodes": [
{
"nodes": [
{
"text": "failure to pay dues within 6 months ~ suspension"
},
{
"text": "more than 1 year ~ remove from roll of attorneys"
}
],
"text": "dues"
},
{
"nodes": [
{
"text": "1. disbarment"
},
{
"text": "2. reprimand"
},
{
"text": "3. admonition"
},
{
"text": "4. warning"
},
{
"text": "5. probation"
},
{
"text": "6. interim suspension"
},
{
"text": "7. censure"
},
{
"text": "8. suspension"
}
],
"text": "discipline DRAW PICS"
},
{
"nodes": [
{
"text": "court of appeals"
},
{
"text": "rtc"
},
{
"text": "until futher action of the SC"
},
{
"text": "... SC after full investigation\nSC may revoke, shorten or extend the suspension, or disbar"
}
],
"text": "suspend"
},
{
"direction": "left",
"nodes": [
{
"text": "exclusive power of SC"
},
{
"nodes": [
{
"text": "1. deceit"
},
{
"text": "2. malpractice"
},
{
"text": "3. or other gross misconduct"
},
{
"text": "3. grossly immoral conduct"
},
{
"text": "4. conviction of a crime involving moral turpitude"
},
{
"text": "5. or for any violation of the oath"
},
{
"text": "6. wilful disobedience of any lawful order of a superior court"
},
{
"text": "7. for corruptly or wilfully appearing as an attorney ... without authority"
},
{
"text": "8. soliciting cases at law for the purpose of gain ... is malpractice"
}
],
"text": "grounds"
},
{
"nodes": [
{
"text": "SC"
},
{
"text": "IBP, Committee on Bar and Discipline"
},
{
"text": "Office of the Sol Gen"
}
],
"text": "authorized to investigate"
},
{
"nodes": [
{
"text": "SC, motu proprio"
},
{
"text": "IBP upon verified complaint by any person"
}
],
"text": "prceeding instituted in"
},
{
"nodes": [
{
"text": "motu proprio"
},
{
"text": "referral by SC"
},
{
"text": "referral by Chapter"
},
{
"text": "instance of any person"
}
],
"text": "initiated and prosecuted by IBP"
},
{
"nodes": [
{
"text": "Verified"
},
{
"text": "Facts stated clearly. concisely"
},
{
"text": "Affidavit of person having personal knowlege"
},
{
"text": "6 copies"
},
{
"text": "charges against judges and justice\n...only to SC"
}
],
"text": "complaint"
},
{
"nodes": [
{
"text": "3 investigators (30 days)"
},
{
"text": "review by board of governors (30 days)"
},
{
"nodes": [
{
"text": "MR (although not mentioned in the rules)"
},
{
"text": "transmit to SC"
}
],
"text": "finding of guilt"
}
],
"text": "procedure in IBP"
},
{
"nodes": [
{
"text": "initiated motu proprio"
},
{
"text": "may refer for investigationto\nSolGen, or officer of SC or judge of lower court"
}
],
"text": "procedure in SC"
}
],
"text": "disbarment"
},
{
"nodes": [
{
"text": "requires positive evidence of rehabilitation"
},
{
"nodes": [
{
"text": "character and standing prior disbarment"
},
{
"text": "nature and character of misconduct"
},
{
"text": "conduct subsequent disbarment"
},
{
"text": "efficient government service"
},
{
"text": "time elapsed ~ sufficiently punished and disciplined"
},
{
"text": "appreciation of significance"
},
{
"text": "favorable endorsement of IBP, local gov't, or community"
}
],
"text": "criteria"
},
{
"nodes": [
{
"text": "sworn statement through Office of Bar Confidant\nthat he desisted from practice of law\nnot appeared in any court"
},
{
"text": "furnish copy to IBP, Executive judge who handled the case"
},
{
"text": "statement shall be proof of compliance with order of suspension"
}
],
"text": "lifting order of suspension"
}
],
"text": "reinstatement"
}
],
"text": "the integrated bar"
}

103
data/ibp.yaml Normal file
View File

@ -0,0 +1,103 @@
the integrated bar:
dues:
failure to pay dues within 6 months ~ suspension
more than 1 year ~ remove from roll of attorneys
discipline DRAW PICS:
1. disbarment
2. reprimand
3. admonition
4. warning
5. probation
6. interim suspension
7. censure
8. suspension
suspend:
court of appeals
rtc
until futher action of the SC\n
... SC after full investigation\nSC may revoke, shorten or extend the suspension, or disbar
disbarment:
direction:left
exclusive power of SC
grounds:
1. deceit
2. malpractice
3. or other gross misconduct
3. grossly immoral conduct
4. conviction of a crime involving moral turpitude
5. or for any violation of the oath
6. wilful disobedience of any lawful order of a superior court
7. for corruptly or wilfully appearing as an attorney ... without authority
8. soliciting cases at law for the purpose of gain ... is malpractice
authorized to investigate:
SC
IBP, Committee on Bar and Discipline
Office of the Sol Gen
prceeding instituted in:
SC, motu proprio
IBP upon verified complaint by any person
initiated and prosecuted by IBP:
motu proprio
referral by SC
referral by Chapter
instance of any person
complaint:
Verified
Facts stated clearly. concisely
Affidavit of person having personal knowlege
6 copies
charges against judges and justice\n...only to SC
procedure in IBP:
3 investigators (30 days)
review by board of governors (30 days)
finding of guilt:
MR (although not mentioned in the rules)
transmit to SC
procedure in SC:
initiated motu proprio
may refer for investigationto\nSolGen, or officer of SC or judge of lower court
reinstatement:
requires positive evidence of rehabilitation
criteria:
character and standing prior disbarment
nature and character of misconduct
conduct subsequent disbarment
efficient government service
time elapsed ~ sufficiently punished and disciplined
appreciation of significance
favorable endorsement of IBP, local gov't, or community
lifting order of suspension:
sworn statement through Office of Bar Confidant\nthat he desisted from practice of law\nnot appeared in any court
furnish copy to IBP, Executive judge who handled the case
statement shall be proof of compliance with order of suspension

131
data/insurance.yaml Normal file
View File

@ -0,0 +1,131 @@
insurance:
definition:
agreement whereby on undertakes to indemnity
for a compensation (premium)
against damages, loss, liability
arising from an unknown or contingent event
characteristics:
risk distributing
adhesion
aleatory
uberrimae fides
personal
elements:
insurable interest
risk of loss
assumption
scheme to distribute
premiums
insurable interest:
life:
childrenDirection:down
every person has:
a. on himself, spouse, children
b. on whom he depens wholly\n...education\nsupport\npecuniary
c. legal obligation for payment of money\nor respecting property or service\n~on debtor's life
d. upon whose life any estate or interest\nvested in him depends
b,c,d requires pecuniary interest
general test.. interested in the preservation
distinction:
extent
time when interest must exist
beneficiary's interest\nand consent of insurer at assignment
property:
matter of public policy\nestoppel not applicable
if he derives pecuniary benefit or advantage from preservation
and pecuniary loss, damage, prejudice by its destruction
existing interest
or inchoate interest founded upon existing interest
or expectancy couple with existing interest
change of interest in thing:
suspends the insurance until the interest in thing\nand in the insurance\is vested on same person
premium:
is the consideration paid
section 77:
no policy issued or renewed is binding until payment of premium
as amended:
RA 10607, 90-day credit extension\nunder broker agency agreement
exceptions:
childrenDirection:down
(UCPB General vs Masagana, citing Makati Tuscany)
1. life, grace period
2. acknowlegement in the policy
3. installments and partial paymen
4. credit term agreed
5. estoppel on both parties
devises for controlling risk:
concealment:
neglect to communication that which knows and ought to
notes:
entitles insurer to rescind\neven for unrelated cause of injury
good faith not a defense\nwhether intentional or unintentional
test of materiality:
reasonable influence on forming estimates
misrepresentation:
factual statements, made prior to issuance
induce him to enter into insurance contract\n(collateral inducement)
same test on materiality
entitles rescission the moment .. becomes false
warranties:
statements or promises by the insured set forth in the policy
untruth, regardless of prejudice makes contract voidable
entitles rescission, exception:
loss before time of performance of warranty
performance becomes unlawful or impossible
representation vs warranty:
collateral, part of contract
may be oral
representation must be established vs conclusively presumed
representation need only be substantially true
incontestibility:
life insurance payable at death
in force
during the lifetime of the insured
for a period of two years
double insurance:
same insured
same subject matter
same interest
same risk
two or more insurers insuring separately
claim:
settlement:
60 days from notice, proof of death
30 days from ascertainment of loss or\nif no ascertainment\n90 from submission of proof of loss
proof of loss:
without necessary delay
only substanial complaince of proof is required
prescrition:
enforcement of contract ~ 10 years from cause accrues
if there is stipulation, not less than 1 year
cause of action accrues at final rejection, not from loss

519
data/judicial.json Normal file
View File

@ -0,0 +1,519 @@
{
"nodes": [
{
"childrenDirection": "down",
"nodes": [
{
"nodes": [
{
"text": "pre-requisite of the rule of law"
},
{
"text": "fundamental guarantee to a fair trial"
},
{
"text": "in both individual and"
},
{
"text": "institutional aspects"
}
],
"text": "INTEGRITY"
},
{
"nodes": [
{
"text": "individual independence"
},
{
"text": "institutional independence"
}
],
"text": "exemplify the two aspects"
},
{
"nodes": [
{
"text": "partisan or personal interest"
},
{
"text": "public opinion or fear of criticism"
}
],
"text": "unswayed by"
},
{
"nodes": [
{
"text": "RA 3019 - anti graph"
},
{
"text": "Artile 204 - rendering unjust judgment"
}
],
"text": "laws"
},
{
"nodes": [
{
"text": "spouse"
},
{
"text": "sons and daughters"
},
{
"text": "son and daughter-in-law"
},
{
"text": "consanguinity or affinity with 6 degrees"
},
{
"text": "companion or employee who lives in household"
}
],
"text": "a judge's family"
}
],
"text": "canon 1"
},
{
"nodes": [
{
"nodes": [
{
"text": "proper discharge of office"
},
{
"text": "personal demeanor"
},
{
"text": "steadfast adherence to strict moral and ethical code"
},
{
"text": "justice done but also seen to be done"
}
],
"text": "INTEGRITY"
}
],
"text": "canon 2"
},
{
"childrenDirection": "down",
"nodes": [
{
"nodes": [
{
"text": "applies not only to the decision itself\nbut also to the process it is made"
},
{
"text": "no consciousness or sense of favor, bias or prejudice"
}
],
"text": "IMPARTIALITY"
},
{
"nodes": [
{
"text": "a biased judge is better than no judge at all"
}
],
"text": "rule of necessity"
},
{
"nodes": [
{
"text": "1. actual bias or personal knowledge on evidentiary facts"
},
{
"text": "2. previously served as lawyer"
},
{
"text": "3. member of family has pecuniary interest in outcome"
},
{
"text": "4. served as guardian, executor, administrator\nformer associate served as counsel during the association\nwas material witness"
},
{
"text": "5. ruling in a lower court under his review"
},
{
"text": "6. related 6th degree to litigant, 4th degree to counsel"
},
{
"text": "7. child, spouse, has financial interest in the subject matter"
}
],
"text": "disqualification (section 5)"
},
{
"nodes": [
{
"text": "1. Disclosure"
},
{
"text": "2. incorporated in the Records"
},
{
"text": "3. Acceptance by all"
},
{
"text": "4. Writing"
}
],
"text": "remittal"
},
{
"nodes": [
{
"text": "1. wife, child, pecuniary interest"
},
{
"text": "2. related 6th, 4th"
},
{
"text": "3. executor, guardian, trustee or counsel"
},
{
"text": "4. presided in a lower court"
}
],
"text": "under rules of court"
},
{
"nodes": [
{
"text": "sound discretion"
},
{
"text": "just and valid reasons"
},
{
"text": "prejudice must be shown from extraneous sources"
}
],
"text": "voluntary inhibition"
}
],
"text": "canon 3"
},
{
"childrenDirection": "down",
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "free from any whiff of impropriety"
}
],
"text": "PROPRIETY"
},
{
"nodes": [
{
"text": "not use position to advance private interest"
},
{
"text": "not give impression that she can be influenced"
}
],
"text": "section 8"
},
{
"nodes": [
{
"text": "RPC 229, revelation of secrets by officer"
},
{
"text": "RPC 230, revelation of secrets of private individual"
},
{
"text": "RA 3019 Sec 3[k] divulging valuable information, officer"
}
],
"text": "confidential information, violation"
},
{
"nodes": [
{
"text": "judicially-related activities\n... consti prohibits quasi-judicial functions"
},
{
"text": "must not detract from the dignity of judicial office"
},
{
"text": "must not interfere with performance"
}
],
"text": "extra-activities of judges"
},
{
"nodes": [
{
"text": "1. reflect adversely"
},
{
"text": "2. interfere with performance"
},
{
"text": "3. persons and lawyers likely to come before court"
}
],
"text": "financial activities"
},
{
"nodes": [
{
"nodes": [
{
"text": "a. executor"
},
{
"text": "b. administrator"
},
{
"text": "c. trustee"
},
{
"text": "d. guardian"
}
],
"text": "gr, not serve as"
},
{
"nodes": [
{
"text": "immediate family member\naa.limited to spouse\nb.relative within 2nd degree\n..by consanguinity"
}
],
"text": "except"
}
],
"text": "fiduciary activities"
},
{
"nodes": [
{
"nodes": [
{
"text": "not habitual or customarily holding"
},
{
"text": "isolated cases"
}
],
"text": "not private practice"
}
],
"text": "prohibited from private practice"
},
{
"nodes": [
{
"nodes": [
{
"text": "insignificant value"
},
{
"text": "regularity of the occasion"
},
{
"text": "source of the gift\n..from party-litigant, value is immaterial"
}
],
"text": "gift"
},
{
"text": "loans"
},
{
"text": "favors"
}
],
"text": "cannot act"
}
],
"text": "canon 4"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "no bias from judge"
},
{
"text": "from staff"
},
{
"text": "from lawyers"
}
],
"text": "EQUALITY"
}
],
"text": "canon 5"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "earnest willigness and capability to promptly do\nwhat is required in accordance to rules"
}
],
"text": "COMPETENCE"
}
],
"text": "canon 6"
},
{
"direction": "left",
"nodes": [
{
"text": "not liable in absence of fraud, dishonesty, or corruption"
},
{
"nodes": [
{
"text": "when error is so gross or patent"
},
{
"text": "or when procedure is so basic or elementary"
}
],
"text": "except"
},
{
"nodes": [
{
"text": "Article 27"
},
{
"text": "Artilce 32"
},
{
"text": "damages in general"
}
],
"text": "civil"
},
{
"nodes": [
{
"text": "1. Article 204, unjust judgment"
},
{
"text": "2. Article 205, judgment rendered through negligence"
},
{
"text": "3. Article 206, unjust orders"
}
],
"text": "rpc"
},
{
"nodes": [
{
"text": "bribery"
},
{
"text": "dishonesty"
},
{
"text": "gross misconduct"
},
{
"text": "unjust judgment"
},
{
"text": "gross ignorance"
}
],
"text": "serious charges"
},
{
"nodes": [
{
"text": "undue delay in rendering decision"
},
{
"text": "habitual absences, tardiness"
},
{
"text": "unauthorized practice"
},
{
"text": "simple misconduct"
}
],
"text": "less serious charges"
},
{
"nodes": [
{
"text": "vulgar and unbecoming conduct"
},
{
"text": "gambling"
},
{
"text": "fraternizing with lawyers and litigants"
},
{
"text": "undue delay is reports"
}
],
"text": "light charges"
}
],
"text": "Liabilities"
},
{
"direction": "left",
"nodes": [
{
"nodes": [
{
"text": "implies malice or wrongful intent"
}
],
"text": "serious misconduct"
},
{
"nodes": [
{
"text": "incompetence, gross negligence"
}
],
"text": "inefficiency"
},
{
"nodes": [
{
"text": "SC motu proprio"
},
{
"text": "verified complaint with affidavits"
},
{
"text": "anonymous complaint with public record of indubitable integrity"
}
],
"text": "filing"
},
{
"text": "administrative proceeding ~ substantial evidence"
},
{
"text": "disbarment ~ preponderance"
}
],
"text": "Discipline"
}
],
"text": "judicial ethics"
}

217
data/judicial.yaml Normal file
View File

@ -0,0 +1,217 @@
judicial ethics:
canon 1:
childrenDirection:down
INTEGRITY:
pre-requisite of the rule of law
fundamental guarantee to a fair trial
in both individual and
institutional aspects
exemplify the two aspects:
individual independence
institutional independence
unswayed by:
partisan or personal interest
public opinion or fear of criticism
laws:
RA 3019 - anti graph
Artile 204 - rendering unjust judgment
a judge's family:
spouse
sons and daughters
son and daughter-in-law
consanguinity or affinity with 6 degrees
companion or employee who lives in household
canon 2:
INTEGRITY:
proper discharge of office
personal demeanor
steadfast adherence to strict moral and ethical code
justice done but also seen to be done
canon 3:
childrenDirection:down
IMPARTIALITY:
applies not only to the decision itself\nbut also to the process it is made
no consciousness or sense of favor, bias or prejudice
rule of necessity:
a biased judge is better than no judge at all
disqualification (section 5):
1. actual bias or personal knowledge on evidentiary facts
2. previously served as lawyer
3. member of family has pecuniary interest in outcome
4. served as guardian, executor, administrator\nformer associate served as counsel during the association\nwas material witness
5. ruling in a lower court under his review
6. related 6th degree to litigant, 4th degree to counsel
7. child, spouse, has financial interest in the subject matter
remittal:
1. Disclosure
2. incorporated in the Records
3. Acceptance by all
4. Writing
under rules of court:
1. wife, child, pecuniary interest
2. related 6th, 4th
3. executor, guardian, trustee or counsel
4. presided in a lower court
voluntary inhibition:
sound discretion
just and valid reasons
prejudice must be shown from extraneous sources
canon 4:
direction:left
childrenDirection:down
PROPRIETY:
free from any whiff of impropriety
section 8:
not use position to advance private interest
not give impression that she can be influenced
confidential information, violation:
RPC 229, revelation of secrets by officer
RPC 230, revelation of secrets of private individual
RA 3019 Sec 3[k] divulging valuable information, officer
extra-activities of judges:
judicially-related activities\n... consti prohibits quasi-judicial functions
must not detract from the dignity of judicial office
must not interfere with performance
financial activities:
1. reflect adversely
2. interfere with performance
3. persons and lawyers likely to come before court
fiduciary activities:
gr, not serve as:
a. executor
b. administrator
c. trustee
d. guardian
except:
immediate family member\naa.limited to spouse\nb.relative within 2nd degree\n..by consanguinity
prohibited from private practice:
not private practice:
not habitual or customarily holding
isolated cases
cannot act:
gift:
insignificant value
regularity of the occasion
source of the gift\n..from party-litigant, value is immaterial
loans
favors
canon 5:
direction:left
EQUALITY:
no bias from judge
from staff
from lawyers
canon 6:
direction:left
COMPETENCE:
earnest willigness and capability to promptly do\nwhat is required in accordance to rules
Liabilities:
direction:left
not liable in absence of fraud, dishonesty, or corruption
except:
when error is so gross or patent
or when procedure is so basic or elementary
civil:
Article 27
Artilce 32
damages in general
rpc:
1. Article 204, unjust judgment
2. Article 205, judgment rendered through negligence
3. Article 206, unjust orders
serious charges:
bribery
dishonesty
gross misconduct
unjust judgment
gross ignorance
less serious charges:
undue delay in rendering decision
habitual absences, tardiness
unauthorized practice
simple misconduct
light charges:
vulgar and unbecoming conduct
gambling
fraternizing with lawyers and litigants
undue delay is reports
Discipline:
direction:left
serious misconduct:
implies malice or wrongful intent
inefficiency:
incompetence, gross negligence
filing:
SC motu proprio
verified complaint with affidavits
anonymous complaint with public record of indubitable integrity
administrative proceeding ~ substantial evidence
disbarment ~ preponderance

324
data/nego.yaml Normal file
View File

@ -0,0 +1,324 @@
negotioable\ninstruments\nlaw:
negotiability (section 1):
childrenDirection:down
W - written instrument signed by maker or drawer
U - unconditional promise or order\n to pay certain sum of money
P - payable on demand or at a determinable future time
O - rder or bearer
N - when ADDRESS to a drawee\n NAMED or indicated with certainty
features:
negotiability:
pass from hand to hand similar to money as to give the\nholder in due course right to hold free from defenses
accumulation of contracts:
as negotiated, as series of juridical ties arise
promissory note (184):
unconditional promise in writing
made by one person to another
signed by the maker
engaging to pay on demand or at a fixed determinable future time
a sum certain in money
to bearer or order.
where drawn to the maker's own name, not complete until endorsed
bill of exchange (126):
order in writing
addressed to a another
signed by the person giving it
requiring person whom it is addressed
to pay on demand or at a fixed determinable..
a sum certain in money
bill may be treated as note when:
name:bill_as_note
drawer, drawee same person
fictitious drawee
drawee no capacity to contract
instrument is ambiguous
stated installments:
dates must be fixed or determinable
amount stated
payable on demand:
when so expressed
no time fixed
when issued, accepted, indorsed when overdue\nas to such person so issuing...
payable to bearer:
when so expressed
when payable to a person named OR BEARER
fictitious or non-existing person
does not purport to be the name of a person ie. CASH
last indorsement is an indorsement in blank
... NOT negotiable when payable to a specified person
negotiation:
transfer such as to constitute the transferee a holder
if bearer, by delivery:
may however be indoresed specially
bearer instrument, always bearer
indoresment:
qualified - without recourse
restrictive:
childrenDirection:down
pay to x only - prohibits further negotiation
pay to x for collection - constitutes indorsee as agent
pay to x in trust of y - vests the title in trust
holder:
childrenDirection:down
payee or indorsee in possession of the instrument
holder in due course has taken the instrument:
childrenDirection:down
C - complete and regular upon its face
O - received before over due, no knowledge of previous dishonor
V - acquired in good faith and for value:
consideration sufficient to support a contract
N - no notice of infirmity or defect of title:
circumstances should have put him in inquiry
holder not in due course:
may sue thereon
payment discharges
but subject to personal defenses
exception Section 58:
a holder who is not a holder in due course but one\nderiving title from an HDC
forgery:
direction:left
childrenDirection:down
REAL defense
forged signature is wholly inoperative:
no right to retain
no right to give discharge
or enforce payment thereon
but not the instrument itself
and not the genuine signatures
not liable:
person,including indorsee\nwhose signature is forged
persons prior him also not liable
payment on such forged indorsement is not to the DRAWER's ORDER
exception:
parties who warrant; acceptors, indorsers
precluded from settin up forgery:
negligence
if bearer instrument:
persons who indorse are liable to those\nwho acquire title through their indorsement
M - A specificially to B in blank to - C - D:
childrenDirection:down
D did not acquire title through A & B's indorsement
ratified
effects of (14 15 16):
direction:left
framed:true
childrenDirection:down
incomplete but delivered (SECTION 14):
_class:style2
childrenDirection:down
wanting any material particular:
person in possession has prima facie authority to complete
a signature on a blank:
delivered by a person making, prima facie authority to fill
in both cases:
childrenDirection:down
instrument must be filled in accordance with authority given
and within reasonable time
hdc:
childrenDirection:down
may enforce as if filled strictly according to authorithy\nand within reasonable time
DELIVERY is CONCLUSIVELY PRESUMED
nhdc:
may enforce against parties subsequent to completion
personal defense
non-delivery of incomplete instrument (SECTION 15):
real defense
incomplete and undelivered, not valid in the hands of ANY HOLDER:
even against an HDC
subsequent indorsers - liable for their warranty
delivery is not conclusively presumed:
only prima facie
mechanically complete but undelivered (SECTION 16):
undelivered instrument is incomplete
in the hands of HDC, delivery is conclusively presumed
as between immediate parties, and remote not HDC:
delivery may be shown to be conditional, for special purpose, and not for transferring title
summary of rules:
1. delivery is essential to validity
2. between immediate parties, delivery must be with intent to pass title
3. incomplete and undelivery invalid as to maker
4. as to 3, in the hands of HDC, prima facie delivery
5. mechanically complete undelivered, prima facie delivery
6. as to 5, in the hands of HDC, conclusively presumed
material alterations:
changes the effect of the instrument
avoids the instrument except as to:
those made,
authorized,
assented,
subsequent indorsers
parties and liabilities:
direction:left
framed:true
childrenDirection:down
accommodation:
primarily liable
signed the instrument
as drawer, maker, acceptor, indorser
withour receiving value
for purpose of lending his name or credit
maker:
primarily liable
1. engages to pay according to the tenor
2. admits existence of payee and his capacity to indorse
acceptor:
primarily liable
1. engages to pay according to tenor
2. admits existence of drawer and authority
3. admits existence of payee and capacity
drawer:
secondary
1. admits existence of payee and his capacity to indorse
2. engages that the instrument will be accepted
3. engages that if dishonored and proper proceedings
indorser:
childrenDirection:down
Every person negotiating an instrument by\ndelivery or by a qualified indorsement warrants (SECTION 65):
childrenDirection:down
(a) instrument is genuine and in all respects what it purports to be;
(b) That he has a good title to it;
(c) all prior parties had capacity to contract;
(d) he has no knowledge of any fact which would\nimpair the validity of the instrument\nor render it valueless.
Liability of general indorser (SECTION 66):
childrenDirection:down
(a) A,B,C of 65
(b) instrument is at the time of his indorsement valid and subsisting.
1. he engages that on due presentment\nit shall be accepted or paid, or both\naccording to tenor
2. and that if it be dishonored\nand the necessary proceedings on dishonor be duly taken\nhe will pay the amount thereof to the holder\nor to any subsequent indorser who may be compelled to pay it.
presentment:
direction:left
childrenDirection:down
requisites:
place
hour
to person primarily liable
exhibit instrument, surrender if paid
not necessary:
drawer or indorser .. no right to expect ..
dispenseed with
notice to drawer:
direction:left
not necessary when:
like when bill treated as note:
name:like_bill_as_note
or countermanded payment
notice dispensed (114, 115):
as to drawer:
1. drawer, drawee same person
2. fictitious
3. drawer same person to whom ... presented for payment
4. drawer no right to expect
5. drawer countermanded payment
as to indorser:
1. drawee fictitious
2. indorser same person to whom ... presented for payment
3. when instrument is accepted for indorser's accommodation
discharge:
1. payment in due course by principal
2. or by or accommodated
3. intentional cancellation
4. other act that discharges contract for payment of money
5. principal debtor becomes holder in his own right
discharge of secondarily liable:
discharge of instrument
cancellation
discharge of prior party
agreement to extend
payment in due course:
made at or after maturity
to holder
in good faith and without notice
edges:
bill_as_note, like_bill_as_note

142
graph.pde Normal file
View File

@ -0,0 +1,142 @@
import java.util.Collections;
import java.util.Iterator;
class Edge {
Node from;
Node to;
}
class Node {
String name;
String direction;
String childrenDirection;
String text;
LayoutInfo layout = new LayoutInfo();
Style style = new Style();
Node parent = null;
Boolean framed;
ArrayList children = new ArrayList();
ArrayList edges;
Node getChildByName(String name) {
if (this.name != null && this.name.equals(name)) {
return this;
}
for(Object c : children) {
Node n = ((Node)c).getChildByName(name);
if (n != null)
return n;
}
return null;
}
Node _loadNode(Node n, JSONObject json) {
try {
n.name = json.getString("name");
}
catch(Exception e) {
}
try {
n.text = json.getString("text");
}
catch(Exception e) {
}
try {
n.direction = json.getString("direction");
}
catch(Exception e) {
n.direction = "right";
}
if (n.text.equals("_style") && n.parent != null) {
try {
n.parent.style.loadStyle(json);
} catch (Exception e) {
}
}
if (n.text.indexOf("_") == 0)
return null;
try {
n.childrenDirection = json.getString("childrenDirection");
}
catch(Exception e) {
n.childrenDirection = "";
}
try {
n.framed = json.getString("framed").equals("true") ? true : false;
}
catch(Exception e) {
}
// children
try {
JSONArray jnodes = json.getJSONArray("nodes");
for (int i = 0; i < jnodes.size(); i++) {
JSONObject jchild = jnodes.getJSONObject(i);
Node child = new Node();
child.parent = n;
if (_loadNode(child, jchild) != null)
n.children.add(child);
}
}
catch (Exception e) {
}
return n;
}
void _dump(Node n) {
println(n.text);
for (Object obj : n.children) {
_dump((Node)obj);
}
}
void load(String fullPath) {
try {
JSONObject jobj = loadJSONObject(fullPath);
_loadNode(this, jobj);
this.edges = new ArrayList();
// load edges
try {
JSONArray jedges = jobj.getJSONArray("edges");
for (int i = 0; i < jedges.size(); i++) {
JSONObject jchild = jedges.getJSONObject(i);
String in1 = jchild.getString("n1");
String in2 = jchild.getString("n2");
Edge e = new Edge();
e.from = this.getChildByName(in1);
e.to = this.getChildByName(in2);
if (e.from != null || e.to != null) {
this.edges.add(e);
}
}
println("edges:" + root.edges.size());
}
catch(Exception e) {
}
//_dump(this);
}
catch (Exception e) {
println("unable to load " + fullPath);
}
}
}

234
layout.pde Normal file
View File

@ -0,0 +1,234 @@
class LayoutInfo extends Rect {
Rect bounds = new Rect();
Position port = new Position();
Position childrenPort = new Position();
ArrayList children;
}
class Layout {
ArrayList all;
String mode = null;
Rect getBounds() {
Rect r = new Rect();
for (Object c : all) {
Node nc = (Node)c;
r.addToBound(nc.layout);
}
return r;
}
int _getNodeDepth(Node n) {
int d = 1;
if (n.parent != null) {
d += _getNodeDepth(n.parent);
}
return d;
}
int _getDepth() {
int d = 1;
for (Object c : all) {
Node nc = (Node)c;
int dd = _getNodeDepth(nc);
if (dd > d)
d = dd;
}
return d;
}
void _reset(Node n) {
n.layout = new LayoutInfo();
n.layout.children = new ArrayList();
all.add(n);
for (Object c : n.children) {
Node nc = (Node)c;
if (n.parent == null && mode != null) {
if (!nc.direction.equals(mode))
continue;
}
_reset(nc);
n.layout.children.add(nc);
}
}
void _calculateSize(Node n) {
Style style = n.style;
Rect exT = style.calculateTextExtents(n.text, style.textSize);
n.layout.width = exT.width;
n.layout.height = exT.height;
ArrayList children = n.layout.children;
for (Object c : children) {
Node nc = (Node)c;
_calculateSize(nc);
}
}
void _calculateBounds(Node n) {
n.layout.bounds.reset();
n.layout.bounds.addToBound(n.layout);
ArrayList children = n.layout.children;
for (Object c : children) {
Node nc = (Node)c;
_calculateBounds(nc);
n.layout.bounds.addToBound(nc.layout.bounds);
}
}
void _position(Node n) {
Style style = n.style;
Rect exT = style.calculateTextExtents(n.text, style.textSize);
Rect exS = style.calculateTextExtents(" ", style.textSize);
float margin = (exS.height * 0.25 * style.margin);
float spacing = (exS.width * 0.25 * style.spacing);
n.layout.width = exT.width + margin;
n.layout.height = exT.height + (exS.height * 0) + margin;
float xx = n.layout.x + n.layout.width + (spacing * 2);
float yy = n.layout.y;
if (n.childrenDirection.equals("down")) {
xx = n.layout.x + (n.layout.width / 2) + spacing;
yy = n.layout.y + n.layout.height + (spacing * 2);
}
ArrayList children = n.layout.children;
for (Object c : children) {
Node nc = (Node)c;
nc.layout.x = xx;
nc.layout.y = yy;
yy += nc.layout.bounds.height + spacing;
if (mode == "left") {
nc.layout.x = n.layout.x - (nc.layout.width) - (spacing * 2);
if (n.childrenDirection.equals("down")) {
nc.layout.x += (n.layout.width / 2);
}
}
_position(nc);
}
}
void _calculatePorts(Node n) {
n.layout.childrenPort.x = n.layout.x + n.layout.width;
n.layout.childrenPort.y = n.layout.y + (n.layout.height / 2);
if (mode == "left") {
n.layout.childrenPort.x = n.layout.x;
}
if (n.childrenDirection.equals("down")) {
n.layout.childrenPort.x = n.layout.x + (n.layout.width / 2);
n.layout.childrenPort.y = n.layout.y + (n.layout.height / 2);
}
ArrayList children = n.layout.children;
for (Object c : children) {
Node nc = (Node)c;
_calculatePorts(nc);
nc.layout.port.x = nc.layout.x;
nc.layout.port.y = nc.layout.y + (nc.layout.height / 2);
if (mode == "left") {
nc.layout.port.x = nc.layout.x + nc.layout.width;
}
}
}
void _calculateRootBounds(Node n, Rect b) {
if (n.parent == null)
b.reset();
// padd
Rect r = new Rect(n.layout);
r.expandRect(10);
b.addToBound(r);
for (Object c : n.children) {
Node nc = (Node)c;
_calculateRootBounds(nc, b);
}
}
void layoutBiTree(Node n) {
//n.childrenDirection = "down";
mode = "right";
all = new ArrayList();
_reset(n);
_calculateSize(n);
int d = _getDepth();
for (int i=0; i<d; i++) {
_calculateBounds(n);
_position(n);
}
_calculatePorts(n);
mode = "left";
all.clear();
_reset(n);
_calculateSize(n);
d = _getDepth();
for (int i=0; i<d; i++) {
_calculateBounds(n);
_position(n);
}
_calculateRootBounds(n, n.layout.bounds);
n.layout.y = n.layout.bounds.height/2;
_calculatePorts(n);
// be neutral
n.layout.childrenPort.x = n.layout.x + (n.layout.width/2);
n.layout.childrenPort.y = n.layout.y + (n.layout.height/2);
}
void layoutTree(Node n) {
mode = null;
all = new ArrayList();
_reset(n);
_calculateSize(n);
int d = _getDepth();
for (int i=0; i<d; i++) {
_calculateBounds(n);
_position(n);
}
_calculatePorts(n);
_calculateRootBounds(n, n.layout.bounds);
}
}

255
parsey.py Executable file
View File

@ -0,0 +1,255 @@
#!/usr/bin/python
import sys
import re
import json
import io
def yamlHtml(n):
print '<div class="node">'
print '<div class="text">' + n['text'] + '</div>'
cc = 'children'
if 'direction' in n:
if n['direction'] == 'left':
cc = cc + ' directionLeft'
if 'framed' in n:
print n['framed']
cc = cc + ' framed'
if 'nodes' in n:
print '<div class="' + cc + '">'
for c in n['nodes']:
yamlHtml(c)
print '</div>'
print '</div>'
# dumps the structure back to yaml format
def yamlDump(n, l=0):
ret = ''
tabs = ' '
s = ''
for i in range(l):
s = s + tabs
attribs = [ 'text' , 'name', 'style', 'direction', 'childrenDirection', 'framed', 'collapsed' ]
for nn in attribs:
if nn in n:
t = n[nn].replace("\n", "\\n")
if nn != 'text':
t = tabs + nn + ': ' + t
ret = ret + s + t + "\n"
if 'nodes' in n:
ret = ret + "\n"
for c in n['nodes']:
ret = ret + yamlDump(c, l+1)
ret = ret + "\n"
if 'edges' in n:
ret = ret + tabs + 'edges:' + "\n"
for e in n['edges']:
n1 = e['n1']
n2 = e['n2']
ret = ret + tabs + tabs + n1 + ', ' + n2 + "\n"
return ret
# cleans the parsed yaml file
def walkClean(n):
n.pop('_level')
if '_text' in n:
n['text'] = n['_text']
n.pop('_text')
if len(n['nodes']) == 0:
n.pop('nodes', 0)
return
edges = None
for c in n['nodes']:
if c['_text'] == 'edges':
edges = c
continue
walkClean(c)
if edges != None:
n['nodes'].remove(edges)
n['edges'] = []
for e in edges['nodes']:
m = e['_text'].split(',')
if len(m) > 1:
n['edges'].append( { 'n1': m[0].strip() , 'n2': m[1].strip() })
# print e
def applyStyle(css, n):
if css == None:
return
if 'nodes' not in n:
return
classes = []
if '_class' in n:
cc = [ c.strip() for c in n['_class'].split(' ') ]
for cname in cc:
for cs in css['nodes']:
if cs['text'] == cname:
classes.append(cs)
style = [ c for c in n['nodes'] if c['text'] == '_style' ]
if len(style) > 0:
style = style[0]
classes.append(style)
else:
style = { 'text': '_style' }
n['nodes'].append(style)
nn = {}
for cc in classes:
for a in cc:
nn[a] = cc[a]
for a in nn:
style[a] = nn[a]
style['text'] = '_'
for c in n['nodes']:
applyStyle(css, c)
def newNode(t, l, p):
n = '_text'
v = t
v = v.replace("\\n", "\n")
m = re.search('(.*):(.*)', t)
if m != None:
nn = m.group(1).strip()
vv = m.group(2).strip()
if len(nn) > 0 and len(vv) > 0:
p[nn] = vv
return None
v = v.replace(':','').strip()
child = {
'_level': l,
n: v,
'nodes': []
}
if p != None:
p['nodes'].append(child)
return child
def getLevel(line):
level = 0
m = re.search('^ *', line)
if m != None:
level = len(m.group(0))
return level
list = []
lines = []
def parse(filepath):
root = None
fo = open(filepath, 'r')
for line in fo:
obj = None
# print line
# print '----'
if len(list) > 0 :
obj = list[ len(list) - 1 ]
if len(line.strip()) == 0:
continue
text = line.strip()
if obj == None:
root = newNode(text, 0, None)
list.append(root)
continue
line = line.replace('\t',' ')
# get level
level = getLevel(line)
# print level
while(level <= obj['_level']):
if len(list) == 1:
break
list.pop()
obj = list[ len(list) - 1 ]
child = newNode(text, level, obj)
if child != None:
list.append(child)
obj = child
walkClean(root)
# find css
css = None
if 'nodes' in root:
cc = [ c for c in root['nodes'] if c['text'] == '_css' ]
if len(cc) > 0:
css = cc[0]
applyStyle(css, root)
return root
if sys.argv[0] == __file__:
source = ''
toHtml = '-html' in sys.argv
toJson = '-yaml' not in sys.argv and not toHtml
if len(sys.argv) > 1:
source = sys.argv[len(sys.argv) - 1]
if 'yaml' in source:
root = parse(source)
if toJson:
target = source.replace('yaml','json')
with io.open(target, 'w', encoding='utf-8') as f:
f.write(unicode(json.dumps(root, indent=1, sort_keys=True)))
# print json.dumps(root, indent=1, sort_keys=True)
# print css
elif toHtml:
print ' \
<style> \
.node { } \
.text { } \
.directionLeft { align:right } \
.framed { border:1px solid red; } \
.children { padding-left: 20px } \
</style> \
'
yamlHtml(root)
else:
print yamlDump(root)

69
rect.pde Normal file
View File

@ -0,0 +1,69 @@
class Position {
float x;
float y;
}
class Rect {
float x = 0;
float y = 0;
float width = 0;
float height = 0;
Rect() {
}
Rect(Rect r) {
setRect(r);
}
void setRect(Rect r) {
x = r.x;
y = r.y;
width = r.width;
height = r.height;
}
void expandRect(int size) {
x -= size;
width += (size*2);
y -= size;
height += (size*2);
}
void addToBound(Rect r) {
if (x == 0 && y == 0 && width == 0 && height == 0) {
x = r.x;
y = r.y;
width = r.width;
height = r.height;
return;
}
float x0 = x;
float y0 = y;
float x1 = x + width;
float y1 = y + height;
if (x0 > r.x)
x0 = r.x;
if (y0 > r.y)
y0 = r.y;
if (x1 < r.x + r.width)
x1 = r.x + r.width;
if (y1 < r.y + r.height)
y1 = r.y + r.height;
x = x0;
y = y0;
width = x1 - x;
height = y1 - y;
}
void reset() {
x = 0;
y = 0;
width = 0;
height = 0;
}
}

185
render.pde Normal file
View File

@ -0,0 +1,185 @@
class Renderer {
PGraphics gfx = null;
void begin(PGraphics g) {
gfx = g;
}
void end() {
gfx = null;
}
void _drawEdge(float x0, float y0, float w0, float x1, float y1, float w1, int edgeStyle) {
PGraphics g = gfx;
if (g == null)
g = getGraphics();
float d0 = 1;
float d1 = -1;
float xA = x0 + (w0/2);
float xB = x1 + (w1/2);
x0 += (w0/2);
x1 -= (w1/2);
if (x1 < x0) {
x0 -= w0;
x1 += (w1);
d0 = -1;
d1 = 1;
}
float dX = (x1-x0)*0.5;
float dY = (y1-y0)*0.5;
float ddx = sqrt(dX * dX) * 0.5;
if (edgeStyle == 1) {
float ctl = 1.6;
g.bezier(
x0, y0,
x0+(ddx*d0)*ctl, y0,
x1+(ddx*d1)*ctl, y1,
x1, y1
);
return;
}
g.line(x0, y0, x0+dX, y0);
g.line(x1, y1, x1-dX, y1);
if (dY != 0) {
g.line(x0+dX, y0, x1-dX, y1);
}
}
void _drawNode(Node n) {
PGraphics g = gfx;
if (g == null)
g = getGraphics();
g.pushMatrix();
g.stroke(0);
Style style = n.style;
// ports
g.strokeWeight(0.5 * style.link);
g.stroke(style.linkColor);
g.noFill();
for (Object c : n.children) {
Node nc = (Node)c;
if (n.parent != null) {
drawEdge(n.layout.childrenPort.x, n.layout.childrenPort.y, nc.layout.port.x, nc.layout.port.y);
continue;
}
Rect n1 = n.layout;
Rect n2 = nc.layout;
_drawEdge(n1.x+(n1.width/2), n1.y+(n1.height/2), n1.width * 0, n2.x+(n2.width/2), n2.y+(n2.height/2), n2.width, 1);
}
g.strokeWeight(0.5 * style.border);
Rect r = new Rect((Rect)n.layout);
g.fill(style.fillColor);
g.stroke(style.borderColor);
g.rect(r.x, r.y, r.width, r.height, 4);
Style gs = globalStyle;
Rect ew = gs.calculateTextExtents(n.text, style.textSize);
Rect eh = gs.calculateTextExtents(" ", style.textSize);
float tx = (eh.height / 2) + (r.width / 2) - (ew.width / 2);
float ty = (eh.height / 1.6) + (r.height / 2) - (ew.height / 2);
g.textFont(gs.font, style.textSize);
g.textAlign(style.textAlign);
g.fill(style.textColor);
g.text(n.text, r.x + tx, r.y + ty);
for (Object c : n.children) {
Node nc = (Node)c;
_drawNode(nc);
}
g.popMatrix();
}
void drawEdge(float x, float y, float xx, float yy) {
PGraphics g = gfx;
if (g == null)
g = getGraphics();
float tx = (xx - x)/2;
float ty = (yy - y)/2;
if (y == yy) {
g.line(x, y, xx, yy);
} else {
g.line(x, y, x+tx, y);
g.line(x+tx, y, xx-tx, yy);
g.line(xx, yy, xx-tx, yy);
}
}
void draw(Node root) {
for (Object c : root.edges) {
Edge e = (Edge)c;
if (e.from == null || e.to == null) {
continue;
}
Rect n1 = e.from.layout;
Rect n2 = e.to.layout;
PGraphics g = gfx;
if (g == null)
g = getGraphics();
g.strokeWeight(0.5 * root.style.edge);
g.stroke(root.style.edgeColor);
g.noFill();
_drawEdge(n1.x+(n1.width/2), n1.y+(n1.height/2), n1.width, n2.x+(n2.width/2), n2.y+(n2.height/2), n2.width, 1);
}
_drawNode(root);
}
void saveImage(Node root, float scale) {
Rect r = root.layout.bounds;
int gw = (int)(r.width * scale);
int gh = (int)(r.height * scale);
PGraphics g = createGraphics(gw, gh, JAVA2D);
float xx = r.x * scale;
float yy = r.y * scale;
float ww = (r.width * scale) - g.width;
float hh = (r.height * scale) - g.height;
g.beginDraw();
g.clear();
g.background(255);
g.translate(-xx, -yy);
g.scale(scale);
begin(g);
draw(root);
end();
g.endDraw();
g.save(project + ".png");
println("done");
}
}
Renderer globalRenderer = new Renderer();

111
style.pde Normal file
View File

@ -0,0 +1,111 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.awt.Color;
class Style {
public String name;
public String fontName = "menlo";
public int margin = 2;
public int spacing = 2;
public int border = 1;
public color borderColor = color(0x80);
public int link = 2;
public color linkColor = color(0x40);
public int edge = 1;
public color edgeColor = color(0xff,0x00,0x00);
public int roundCorner = 8;
public color textColor = color(0x0); //color(0xff, 0xff, 0xff);
public color fillColor = color(0xff); //color(0x50, 0x50, 0x50);
public int textSize = 12;
int textAlign = LEFT;
PFont font;
Style() {
}
Style(String name) {
this.name = name;
}
void _prep() {
if (font == null) {
font = createFont(fontName, textSize, true);
}
}
int _stringLines(String l) {
String lines[] = l.split("\n");
return lines.length;
}
float _stringMaxWidth(String l) {
String lines[] = l.split("\n");
float tw = textWidth(" ");
for (String s : lines) {
float tt = textWidth(s + " ");
if (tt > tw)
tw = tt;
}
return tw;
}
Rect calculateTextExtents(String text, int size) {
_prep();
Rect r = new Rect();
textFont(font, size);
r.width = _stringMaxWidth(text) + (this.margin * 2);
r.height = _stringLines(text) * (this.textSize + 6);
return r;
}
void loadStyle(JSONObject s) {
try {
Field fields[] = Style.class.getFields();
for(Field f : fields) {
String sfield = f.toString();
String stype = f.getGenericType().toString();
String sname = sfield.substring(sfield.lastIndexOf(".")+1);
if (stype.equals("int")) {
if (sname.indexOf("color") >= 0 || sname.indexOf("Color") >= 0) {
try {
String sv = s.getString(sname);
String rr = sv.substring(0,2);
String gg = sv.substring(2,4);
String bb = sv.substring(4,6);
color v = color(Integer.parseInt(rr, 16), Integer.parseInt(gg, 16), Integer.parseInt(bb, 16));
f.set(this, v);
} catch(Exception e) {
}
} else {
try {
int v = s.getInt(sname);
f.set(this, v);
} catch(Exception e) {
}
}
}
}
} catch(Exception e) {
println(e);
}
//println(s);
//for(
}
}
Style globalStyle = new Style("global");

148
yaml2mindmap.pde Normal file
View File

@ -0,0 +1,148 @@
String project = "civpro";
Node root;
int defaultBx = 10;
int defaultBy = 10;
int xOffset = 0;
int yOffset = 0;
int bx = defaultBx;
int by = defaultBy;
float scale = 1.4;
float windowScale = 1.0;
float fileScale = 2.0;
boolean locked = false;
int redrawCount = 0;
void doRedraw() {
redrawCount = 20;
loop();
}
void settings()
{
size((int)(1280*windowScale), (int)(720*windowScale));
}
void setup() {
frameRate(32);
root = new Node();
execCommand("python " + dataPath("../parsey.py") + " " + dataPath(project) + ".yaml");
root.load(dataPath(project + ".json"));
Layout l = new Layout();
l.layoutBiTree(root);
centerNode(root.layout);
doRedraw();
}
void draw() {
background(255);
pushMatrix();
translate(bx, by);
scale(scale);
globalRenderer.begin(getGraphics());
globalRenderer.draw(root);
globalRenderer.end();
popMatrix();
if (redrawCount > 0) {
redrawCount--;
noStroke();
fill(0, 255, 0);
rect(10, 10, 5, 5);
} else {
noLoop();
}
}
void mousePressed() {
locked = true;
xOffset = mouseX-bx;
yOffset = mouseY-by;
doRedraw();
}
void mouseDragged() {
if (locked) {
bx = mouseX-xOffset;
by = mouseY-yOffset;
}
doRedraw();
}
void mouseReleased() {
locked = false;
doRedraw();
}
void centerNode(Rect n) {
if (n == null)
return;
float fbx = (width/2) - ((n.x + (n.width/2))* scale);
float fby = (height/2) - ((n.y + (n.height/2))* scale);
bx = (int)fbx;
by = (int)fby;
}
void keyReleased() {
// scale
{
if (key == '-') {
scale -= 0.2;
}
if (key == '=') {
scale += 0.2;
}
if (scale < 0.4)
scale = 0.4;
if (scale > 2.0)
scale = 2.0;
centerNode(root.layout);
}
{
if (key == 'i') {
println("saving image");
globalRenderer.saveImage(root, fileScale);
}
}
if (key == ESC)
key = 0;
doRedraw();
}
void execCommand(String cmd) {
try {
println("run " + cmd);
Process p = Runtime.getRuntime().exec(cmd);
try {
p.waitFor();
}
catch(Exception e) {
println("error running command " + cmd);
}
println("done");
}
catch(java.io.IOException e) {
println(e);
}
}